Originally posted by Giselle Dazzi:
Trying to figure out this type of code :
Any rules Im missing because those variables are part of an abstract class ?
Giselle,
I believe your conclusions are correct. However, there is nothing
wrong with declaring private instance variables in an abstract class. Just know that without corresponding accessors and mutators (getter and setters) the private instance variables are indeed useless in this abstract class.
A more practical example of this abstract class might look like:
Now, concrete implementations will inherit these methods and the private instance variables are not wasted.
HTH,
Tim
Timothy Stone, MIT, SCJP
http://www.petmystone.com/
"This Satan's drink [coffee] is so delicious, we shall cheat Satan and baptize it." --Pope Clement the VIII (1592-1605)