Thursday, January 29, 2015

Chapter 3



Java reads all the class definitions (variables, constructors, methods, etc.) before executing public static void main (String[] args). This means you can have the main program inside a class, and that the program will start with one copy of that particular class. This makes me wonder if you could refer to itself in an array.
The code created a dog object uses variables to define the dog and it's actions, then it 'prints' the strings. The variable x, which is defined as a interger, 0,  is used to determine the number of dogs. that are created.

No comments:

Post a Comment