2
我知道這是一個有趣的問題。我想知道這是否可以完成?我們可以在任務的LHS上構建和使用字符串嗎?
Class foo {
public static void main(String [] args){
for (int i=0; i<5; i++)
//build string obji where i =0..5
//use the built string using stringbuilder and use the built string in this experssion
foo <built string> = new foo();
System.out.println(obj1.somemethod(i));
}
}
public somemethod(i){
return ("I am objet"+i)
}
}
http://stackoverflow.com/questions/4140463/creating-variables -at-runtime-in-java –