Is it possible to create new variables in java dynamically.
class A {
methodA(String variableName) {
}
}
So if new method is called
No, this is not possible to do in Java.
The fields in a class is determined at compile time and can't be changed during runtime (except though sophisticated techniques such as class reloading though for instance JRebel). I would however not recommend doing this, unless you're writing some IDE for instance.