Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why does Object.class compile?

 
Gary Snider
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me where the .class attribute is documented? It is not in the api and not even in Object.java 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
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here. It's not technically an attribute, though it looks like one. It's unique feature in the Java language.
 
Gary Snider
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info.
I guess it was in the JLS after all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic