Ch8 Quiz review Flashcards
The ____ of a class are called the members of a class.
Components
T/F
Finalizers are value-returning methods that return the final value of a variable.
FALSE
T/F Members of a class consist of packages, methods, and libraries.
FALSE
T/F
You can import your classes the same way you import Java classes.
TRUE
Which of the following set of statements are valid in Java?
(i) bigRect.area();
bigRect.perimeter();
bigRect.print();
(ii) bigRect.area = bigRect.area();
bigRect.perimeter = bigRect.perimeter();
bigRect.print();
Only (i)
How do you declare a new reference variable of the type Illustrate and instantiate the object with a value of 9?
Illustrate illObject = new Illustrate(9);
What is the function of the reserved word class?
It defines only a data type / does not allocate memory
T/F An accessor method of a class first accesses the values of the data members of the class and then changes the value of the data members.
FALSE
In ___ copying, each reference variable refers to its own object.
Deep
T/F
In shallow copying, each reference variable refers to its own object.
FALSE
T/F The method finalize automatically executes when the class object goes out of scope.
TRUE
Which statement correctly instantiates the Rectangle object myRectangle?
(i) myRectangle Rectangle = new Rectangle (10,12);
(ii) class myRectangle = new Rectangle (10,12);
(iii) Rectangle myRectangle = new Rectangle (10,12);
Only (iii)
T/F
The following statement is legal:
aa.print();
TRUE
What is the main use of inner classes?
To handle events
T/F The components of a class are called fields.
FALSE