• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reflection API  RSS feed

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In the Java API it says that
"Java reflection is useful because it supports dynamic retrieval of information about classes "

What does Dynamic retrieval mean?/ Does it mean at Run time? If yes, whats the difference between retrieving at compile time and retrieving at run time?/

Thanks.
 
Baalamurugan Raman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Reflection is a powerful and useful technique to introspect object and and its behaviour.

One fine example is say you want some information of a java object which you are not sure what methods and attributes it may contain... then Reflection comes to rescue - it invokes the method at runtime without much information of the class or method ...

In a crip it can say the attributes / methods of an unknown class object.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Baalamurugan" please read the important administrative private message I have just sent you.

CR
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arjun Reddy, if you go through the Java Tutorials you will find a section about reflection.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know what reflection API does guys. I just needs to know what these words "dynamic retrieval" mean.

Thanks.
 
Paul Clapham
Sheriff
Posts: 22828
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, "dynamic" is one of those vague words that people use when they are waving their hands, but generally if you translate it as "at run time" you won't be far off.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!