Programming - Type Casting
You Are Here :: Home > JAVA > Type Casting - General Questions
13.
How to convert an object to string?
A.
Object to String – toString()
B.
Object to String – toChar()
C.
Object to String – toInt()
D.
Object to String – toStringChar()
Answer: Option A
Explanation:
Object to String – toString()
14.
How to compare two objects?
A.
hashCode()
B.
equals()
C.
Both
D.
None
Answer: Option C
Explanation:
Object comparison – hashCode() & equals()
15.
_____________ refers to changing an entity of one datatype into another
A.
Type Casting
B.
Type Converting
C.
Both
D.
None
Answer: Option A
Explanation:
16.
A _____________ variable whose type is the same as the class from which the object was instantiated.An Object as Object is a super class of every Class.Implicit Cast
A.
reference
B.
static
C.
non-static
D.
None
Answer: Option A
Explanation:
17.
A ________ variable whose type is a super class of the class from which the object was instantiated.
A.
reference
B.
static
C.
non-static
D.
None
Answer: Option A
Explanation:
18.
A _____________ variable whose type is an interface that is implemented by the class from which the object was instantiated.
A.
reference
B.
static
C.
non-static
D.
None
Answer: Option A
Explanation:
« prev
next »