O'Reilly logo

Java™ Phrasebook by Timothy Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting a Class Name

Class c = someObject.getClass();
											String s = c.getName();

Getting the name of a Class object is an easy task. You get the class name of any Class object using the getName() method. The String returned by the getName() method will be the fully qualified class name. So for example, if in this phrase, the someObject variable is an instance of the String class, the name returned from the call to getName() will be

java.lang.String

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required