- The word reflection implies that the properties of whatever
being examined are displayed or reflected to someone who wants to
observe those properties. Similarly,
Reflection in Java is the ability to examine and/or modify the
properties or behavior of an object at run-time. It’s important to note that reflection specifically applies to objects – so you need an object of a class to get information for that particular class.
- Reflection is considered to be an advanced technique, and can be quite powerful when used correctly.
- Reflection in Java consists of 2 primary things that you should remember:
- 1. Metadata. Metadata literally means data about the data. In this
case, metadata means extra data that has to do with your Java program –
like data about your Java classes, constructors, methods, fields, etc.
- 2. Functionality that allows you to manipulate the metadata as
well. So, functionality that would allow you to manipulate those
fields, methods, constructors, etc. You can actually call methods and
constructors using Java reflection – which is an important fact to
remember.
what is reflection in java
Reviewed by
Unknown
on
1:25 AM
Rating:
5
No comments: