Programming - Operators
You Are Here :: Home > JAVA > Operators - General Questions
37.
Java provides a run-time operatorinstanceof to compare a___________ and an___________ of that class.
A.
Object,instance
B.
method,instance
C.
class,instance
D.
instance,instance
Answer: Option C
Explanation:
Java provides a run-time operatorinstanceof to compare a class and aninstance of that class.
38.
__________ compares an object to a specified class type.
A.
instanceof
B.
instance
C.
both a and b
D.
all the above
Answer: Option A
Explanation:
instanceof" compares an object to a specified class type.
39.
The________ operator is defined to know about an object's relationship with a class.
A.
method
B.
instanceof
C.
variable
D.
none
Answer: Option B
Explanation:
The instanceof operator is defined to know about an object's relationship with a class.
40.
The ________ operator is defined to know about an object's relationship with a class. It evaluates totrue, if the object or array is an instance of the specified type; otherwise it returns false.
A.
instance
B.
object
C.
instanceof
D.
all the above
Answer: Option C
Explanation:
The instanceof operator is defined to know about an object's relationship with a class. It evaluates totrue, if the object or array is an instance of the specified type; otherwise it returns false.
41.
The________- operator can be used with the arrays and objects.
A.
variable
B.
method
C.
instance
D.
instanceof
Answer: Option D
Explanation:
Theinstanceof operator can be used with the arrays and objects.
42.
_______________ can't be used with primitive data types and values.
A.
instanceof
B.
method
C.
instanceof
D.
variable
Answer: Option A
Explanation:
instanceof can't be used with primitive data types and values.
« prev
next »