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:

ClassName.class notation???

Posted by David W. Liu on September 04, 2000 at 11:00 PM

In Java code, we can write somthing like this:

ClassName var = new ClassName();
Object obj = var;

if (obj.getClass() == ClassName.class) {
// do something...
}
...


Does anyone know where I can find the explainations regarding the use
of ClassName.class notation as shown in above code? I am just
wondering how, when, and where we can use it.

Thanks.




Replies:

Sponsored Links



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