Friday, January 16, 2015

Java Chapter Two


On thing I learned was that instance variables are things an object knows about itself; they represent an object's state, and can have unique values for each object of that type.

Another thing I learned was that methods are things an object can do.



This code creates 3 objects which each have the title, genre, and rating of 3 separate movies. In this code, the dot operator is used to set instance variables to a specific value. As is seen below, this is what the output of the code would be.


No comments:

Post a Comment