Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is reflection and introspection in java.

 
Manish Jaju
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is reflection and introspection in java. Will someone elaborate it with example and how it is used in programs. I will be very thankful.
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manish,

Reflection and introspection refer to the same concept, of looking up a Class programmatically and inspecting the class like how many methods does it have, what are the super classes, implemented interfaces etc....in short you can actually "read" a class.
Not only that, you can also use this concept successfully to create Applications etc.
a good place to start is here(Reflection Tutorial)

A lot of Frameworks depends on reflection like Struts etc, and soon you will appreciate the many ways you can use reflection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic