A
Adam Smith
Hello. I'm wondering if it's okay to construct the same object within
static constructor:
public class Proc
{
public Dataholder d;//some other class
//I've created
static ArrayList al;
int val;
static Proc
{
al = new ArrayList();
for(int n= 0; n<5; n++)
al.Add(new Proc()); //This is the line I'm concerned
//about, adding a new object of the
//same type within static constructor
}
public proc()
{
val = 3;
}
}
Thanks in advance!
Adam Smith
static constructor:
public class Proc
{
public Dataholder d;//some other class
//I've created
static ArrayList al;
int val;
static Proc
{
al = new ArrayList();
for(int n= 0; n<5; n++)
al.Add(new Proc()); //This is the line I'm concerned
//about, adding a new object of the
//same type within static constructor
}
public proc()
{
val = 3;
}
}
Thanks in advance!
Adam Smith