boolean isdata=false; // converting this to true
String qname="data";
String abc="is"+qname;
isdata = true // works here but i dont wanna hard code.. there is much data like this
// i am trying to automate the process. i have basic knowledge of doing it manually
but i want to convert isdata to true now. Is there any implementation for this.
It looks like you’re after something like PHP’s variable variables, which Java doesn’t support (without using Reflection, anyway).
If you must do it this way, you might as well just use a
Map. Since you want to prefix everything with “is”, I’m assuming they’ll all beBooleans.Honestly though, if you’re doing something like this, the way you’ve designed it is probably a bit klunky. You might step back and see if you can improve it.