in JAVA by
Which method of the Class.class is used to determine the name of a class represented by the class object as a String?

i) getClass()

ii) intern()

iii) getName()

iv) toString()

1 Answer

0 votes

iii) getName()

Reason: The getName() method of the Class class returns the name (as String) of the entity (class, interface) represented by this Class object. It is a non-static method, and available in the java.lang package.

The getClass() method of the Object class returns the runtime class of this object. The intern() and toString() methods are of String class.

Related questions

0 votes
asked Apr 10, 2021 in JAVA by Robindeniel
0 votes
asked Apr 8, 2021 in JAVA by SakshiSharma