how to declare object variable name in loop
Posted
by
user3717895
on Stack Overflow
See other posts from Stack Overflow
or by user3717895
Published on 2014-06-08T03:21:29Z
Indexed on
2014/06/08
3:24 UTC
Read the original article
Hit count: 74
public class Node{
Node p,l,r;
int height;
String s;
{
/** class body**/
}
}
String[] S=new String[5000];
int i=0;
while (i<5000){
Node x=new Node();
x=S[i];
}
I want to make 5000 Node object. above code assign same variable name x every time but i want different variable name . then how to declare 5000 class variable name without declaring it manually. is there something by which i can create 5000 Node class object with ease.
© Stack Overflow or respective owner