We did an in-class code demo in this class. See the lecture code repository for this section for the completed example.
Today's example demonstrated:
We saw that the scope of a local variable extends from the point of
declaration to the end of the body in which it is declared.
We saw how to define a non-constructor method. This introduced the
concept of a return-type specification and void.
The scope of an instance variable is the entire class body - an
instance variable can therefore be used in any method of the class.
An instance variable declaration is marked 'private'.