Look inside the Java Reflection class

Java Reflection is a technology that looks inside a Java object at runtime and sees basically everything about the object that you would know at compile time. Discover the basic techniques involved in Reflection.

An Excerpt:

Java Reflection is a technology that looks inside a Java object at runtime and sees what variables it contains, what methods it supports, what interfaces it implements, what classes it extends—basically everything about the object that you would know at compile time.

The Reflection API is located in the java.lang.reflect package and is included in any J2SE installation. Primarily it is intended for very generic programs such as database browsers or visual code editors, but it can be used in any other applications. Reflection is for dealing with class files you know very little about ahead of time. Reflection has a very high overhead, so before using it, you should make sure that you can’t solve your problem with a simple interface, Class.forName(), and a delegate object instead.

 

Read the full article

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s