The only reason you would care about how visible a particular method or field is if you were playing what I call "the game1"
In the game you take some unit of code, like a class, and pretend that someone is going to try and do every possible thing that you can do with it.
If you have methods named stepOne()
, stepTwo()
and stepThree()
- what happens if someone calls them in the wrong order. If you have a field named denominator
- what happens if someone sets it to zero. That sort of thing.
Footnotes
-
Not the game that you just lost by remembering you were playing the game. ↩