I'm learining Java reflection API. I have read a lot, use java.lang.reflect
package. But there is still something I don't understand : the idea that with introspection, you can modify objects at runtime.
Basically you do not need introspection/reflection to do that. With a simple setter() method, you can also modify your object at runtime. What's the difference between using simple setters or using reflection ? In both cases you can achieve the same result.
Aucun commentaire:
Enregistrer un commentaire