class literal

S

Sachin

Does this explain in the java documentation?
Is this a key word?
What is the purpose of this?

Thanks.
 
I

Ian Shef

Does this explain in the java documentation?
Is this a key word?
What is the purpose of this?

Thanks.
A search at http://java.sun.com quickly turned up:

http://java.sun.com/developer/TechTips/1997/tt1118.html#tip3

which explains the use of .class and provides an example.

See paragraphs 15.8 and 15.8.2 in the Java Language Specification (3rd
edition) available at
http://java.sun.com/docs/books/jls/index.html

Suppose that you have an object of class Abc.
Then Abc.class is an object of class java.lang.Class that represents that
class Abc.
This object (Abc.class) can be passed as a parameter to a method.
It can also be queried for information about the class Abc.
See the javadocs for java.lang.Class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,079
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top