File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes why does Object.class compile? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why does Object.class compile?" Watch "why does Object.class compile?" New topic

why does Object.class compile?

Gary Snider

Joined: Apr 20, 2004
Posts: 2
Can someone tell me where the .class attribute is documented? It is not in the api and not even in source code. Obviously Object.getClass() works and is documented. I've seen the .class attribute used quite frequently in production code and it irks me that it is just used and not documented. Perhaps it is in the JLS? I searched once but couldn't find it.
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Here. It's not technically an attribute, though it looks like one. It's unique feature in the Java language.

"I'm not back." - Bill Harding, Twister
Gary Snider

Joined: Apr 20, 2004
Posts: 2
Thanks for the info.
I guess it was in the JLS after all.
I agree. Here's the link:
subject: why does Object.class compile?
jQuery in Action, 3rd edition