June 2018
Beginner
722 pages
18h 47m
English
The getClass() method of the java.lang.Object class looks like this:
public Class getClass(){ //returns object of class Class that has //many methods that provide useful information}
The most commonly used piece of information from this method is the name of the class that was the template for the current object. We will get into why one may need it in Chapter 6, Interfaces, Classes, and Objects Construction. The name of the class can be accessed via the object of the class Class, returned by this method.
Read now
Unlock full access