PPT Slide
Instance vs. Class Variables
Constants Revisited:
class ConstantExample {
final int iMAXSIZE = 10;
} // of ConstantExample
class ConstantExample {
static final int iMAXSIZE = 10;
} // of ConstantExample
Declares a different-but-identical constantfor each instance of the class.
Wasteful with zero benefit.
Declares a single constant for use by all instances of the class.
Previous slide
Next slide
Back to first slide
View graphic version