我有一个只有常数的类.代码片段是:
public class CommonConstant
{
public static final String DAY = "DAY";
public static final String WEEK = "WEEK";
public static final String MONTH = "MONTH";
public static final String YEAR = "YEAR";
public static final String ACCEPTED = "accepted";
public static final String REJECTED = "rejected";
public static final String ADDED = "added";
public static final String MODIFIED = "modified";
}
在类文件中指定常量或者它应该在接口中是一种好习惯吗?
什么是好习惯?