Thursday, January 22, 2015

Head First Java Chapter 3


    In this chapter I learned about primitive and reference variables. Primitive variables values are the bits representing the value. While a reference variable value is the bits representing a way to get to an object on the heap. A reference variable is null when not assigned an object. I learned about creating an array of variables and how it is always an object. I copied this code for a dog program. However, I moved the main method into its own class and put the dog class in a new file. I changed the second line to clarify what the dogs name on the last line was and fixed some grammar.

Dog Program:

Main File:

























Dog File:

















Output:

No comments:

Post a Comment