CSCI A202 - Introduction to Programming (II)

Lecture 5: Anatomy of a simple Java application.

Here's the diagram for the last example discussed in class today.

Remember that a class defines a template that contains:

Class members (data or methods) are identified through the keyword static.

Please note that this addresses only isssues that relate to class and instance variables. The variables that are local to class or instance methods (for example a and b local to main of class A) cannot be accessed from outside the class (A in our example). They serve as local working space (scratch paper) for those methods and the best you can do is to pass them (if you need to) as parameters to other methods.