VERIFIED SOLUTIONS NEW MODIFIED
TESTED AND APPROVED
What do we call the attributes associated with the object, When an object is
created?
instance variables
fixed attributes
instance methods
class instances --CORRECT ANSWER--instance variables
In UML diagrams, to indicate that an instance variable or method is public, we
used which symbol?
#
-
+
* --CORRECT ANSWER--+
Which of the following is true when you examine the following declarations:
int tag;
Page 1 of 28
,String title;
tag is a reference variable, and title is a primitive.
both are reference variables
tag is a reference variable, and title is a primitive.
tag is a primitive variable, and title is a reference variable. --CORRECT
ANSWER--tag is a primitive variable, and title is a reference variable.
All classes in Java can automatically invoke the toString() method.
True
False --CORRECT ANSWER--True
The signature of a method consists of ____________.
method name and parameter list
method name
parameter list
method name, parameter list and return type --CORRECT ANSWER--method
name and parameter list
Page 2 of 28
, The user can invoke a method without zero knowledge about how it is
implemented. The details of the implementation are encapsulated in the method
itself and hidden from the client. What do we call this?
information hiding (encapsulation)
method hiding
simplifying method
instantiation --CORRECT ANSWER--information hiding (encapsulation)
Which of the following statement(s) true?
o return types for Constructors, not even void.
All of the above
Multiple constructors can be written in a class.
When an object is instantiated, we invoke constructors through using the new
operator --CORRECT ANSWER--All of the above
A boolean type, numeric type, object type hold respectively the default value of:
true, 0, null
true, 1, null
false, 1, null
Page 3 of 28