放在类里,而且这个类是final型的
解决方案 »
- TCP/IP是启用的。 我用hibernate创建数据库连接时,它报错:到主机 的TCP/IP连接失败。
- 帮忙介绍一下如何学习应用webservice?
- 关于FusionCharts的参数问题
- linux下启动tomcat,连接被拒绝
- MyEclipse中新建一个MessageBundle.properties文件,如果输入中文保存时就会提示错误
- structs 的标签库中 我想给 你好 2个字加个连接到 dss.jsp 该怎么写?
- 简单的问题--状态拦
- Hibernate 入门级问题
- 高分请教:j2ee的例子PetStore中许多类为什么要实现Serializable 接口
- 请问如何将这段代码改到EJBTESTCLIENT中?
- 高分求助----struts找不到资源????
- 我有个网站要放到英国去,请问谁知道英国那个公司能做托管吗?
public static final String CLEAR_PER_DAY = "1";而接口则直接写成String CLEAR_PER_DAY = "1";就可以了,一般做大型项目,如果需要定义的常量很多,习惯用接口,原因很简单,接口可以套接口,这样你的常量无形中就实现了分类,是好的编码规范哦^_^~~~
1. if you define the constant in the class file, then all the subclass will be have the same set of constants because the constant is an attribute of the class.
2. if you define the constant in the interface, then all classes implement the interface will be able to those constant.