java test 3
Which of the following is an example of the state of a Car object? The ability to turn. The methods of the Car object. The variable used to identify the car. The car's color.
The car's color. color make model and current speed are all examples of the cars state
all java classes have a main method
false, a program can be made up of many classes, and only will likely have a main method
The values of an object's instance data represent the object's identity.
false, because the instance value of two objects could be the same
Instance data is shared by all objects of a class.
false, its not shared- each object has its own memory space for instance data
A constructor is a programming construct that contains data and methods.
false, this describes a class
Encapsulation ensures that an object controls its own data.
true, encapsulation keeps other cold from "reaching in" and changing data values directly
the toString method returns a textual description of an object
true, its usually a good idea to include a toString method when designing a class
each object has its own instance data
true, separate instance data lets an object have a unique state
an object created from a class is called an instance of that class.
true, the process of creating an object is called instantiation
the methods of a class that can be called from other classes make up its public interface
true, the public interface defines the integration that can occur between objects
A class represents a group of similar objects.
true, the term class comes from the word classification
Which of the following is an appropriate analogy? Class: score, Object: scoreboard Class: house, Object: blueprint Class: concept of a dog, Object: my dog Fido Class: cookie, Object: cookie cutter
Class: concept of a dog, Object: my dog Fido the class is the idea, the object is the realization of the idea
