放在类里,而且这个类是final型的
解决方案 »
- 关于jdbcTemplate.queryForObject查询对象的问题
- 有人用存储过程么????????????????????????????????????????????????????????????????????
- JS 如何获取struts2 标签值
- SSH框架项目本机通过IP访问慢,localhost访问不会?
- ??5000-6000笔记本电脑推荐???急
- 真心求教:怎样在根据已有的数据库生成ejb3.0的实体bean和dao
- 当客户端调用Home接口的create()方法时,Bean是否一定被创建?
- Struts配置问题,谢谢大家了
- SQL语句,不会写,帮我
- 数据库操作时出现socket close错误,报以下错误怎么办?
- 高分求助----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.