I'd like to automaticly create a new Variable for my Storage.
It should work like:
int var_count = getConfig().getInt("var_count");
++var_count;
int "var"+var_count = 123
If var_count is for example 4, it should generate a Variable named var4.
I'd like to automaticly create a new Variable for my Storage.
It should work like:
int var_count = getConfig().getInt("var_count");
++var_count;
int "var"+var_count = 123
If var_count is for example 4, it should generate a Variable named var4.
I'd like to automaticly create a new Variable for my Storage.
You can't. You could (however) make a Map<String, Integer>
and store arbitrary key-value pairs. Something like
Map<String, Integer> map = new HashMap<>();
map.put("var" + var_count, 123);
System.out.println(map.get("var" + var_count));