Is it possible in Java to use variables value for type?
For example:
String s = "String";
And then I would create another variable z
, which could use s
value for his type. Is it possible to do that? Maybe with reflection or some other technique?
Update:
If it's not possible this way, maybe someone could suggest how to give type to variable, when you get what type it is from xml files attribute? Like
<tag type="String">MyValue</tag>
And then I could use type
attributes value for defining variables type?