• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to add a new property in Java object using Reflection  RSS feed

 
bhaswar goswami
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am trying to add a new property in a java object on the runtime
using java Reflection .
My first question is can i do that at all ?
If Yes then how ?
Can anyboby help me in this regard
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do it using reflection.

What exactly are your needs? Could you use the Decorator pattern?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!