我知道这是一个有趣的问题。我想知道这是否可以完成?
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)
}
}