Interfaces with Constants Only(java中通用常量定义)
摘要:
Interfaces with Constants Only
Before the static import became available, a trick for avoiding the need to write the class name for static constants was to create an interface whose only purpose is to hold constants.
For example, say that you need the constants ALPHA and OMEGA for several different programs. The first option is to create a utility class that holds the constants. e.g.:
阅读全文
posted @ 2006-03-13 11:05 Bona shen 阅读(1327) 评论(1) 推荐(0) 编辑