The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Re: ClassName.class notation???

Posted by Mahesh Chulet on September 12, 2000 at 2:47 AM

Hello,
Every class is represeneted by a corresponding Class class object. The reference to this object can be obtained using the syntax Class claz = XYZClass.class

The utility of obtaining a reference to the Class class for any class are ,

o. To use reflection methods provided by the Class class
o. To find which ClassLoader was used to load this class
0. To get the Superclass, this class's name or to run any of the method that is available in the Class class

Hope this helps..

-Mahesh Chulet



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us