December 1999
Intermediate to advanced
816 pages
20h 27m
English
Here again are the elements that can go into an interface:
public, static, final data members. This is about the closest you get in Java to a global constant. By default, even if you don't declare them as such, all the data members of an interface are public, static, and final. So you could code
int MAIN_BRANCH_NUMBER = 01;
or you could code
public static final int MAIN_BRANCH_NUMBER = 01;
The Java Language Specification says that it is strongly discouraged to redundantly specify these keywords. I happen to disagree and feel strongly that, for the sake of those who don't know the rules, you should specify the keywords. Doing so is useful for documentation purposes and certainly doesn't hurt anything. What's more, the keywords ...
Read now
Unlock full access