• Post Reply Bookmark Topic Watch Topic
  • New Topic

object.class  RSS feed

 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
What does object.class mean?
Thanks!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's ClassName.class that I think you're talking about. This syntaxt returns the java.lang.Class object that represents ClassName (where ClassName is the name of a class.) It's basically equivalent to Class.forName("ClassName"), except the Class object is cached so it's faster.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!