Hi: In our application,we have retrive some data from the database,for example,the table have columes:id,name,age,address,email.
Then we will get some of these prope
If I understand you right, you want to dynamically add properties to a class, or rather: to a specific instance of a class.
The former is possible e.g. in Groovy, where there is a metaclass object for every class, to which you can assign behavior at runtime, the latter is possible in JavaScript, where you can assign behavior both to an object's prototype and to an object itself. But neither of those versions is possible in Java, so using a Map or a similar structure is the thing to do in Java.