P
Phil Da Lick!
Hi all,
Creating a class library with an object that needs to expose a list of
other objects. Using vs 2008/.NET 3.5.
So far got this:
public class MyClass
{
private ArrayList _Internal=new ArrayList();
public ArrayList List
{
get
{
return(_Internal);
}
}
public MyClass()
{
}
}
My questions:
1. Is it correct to create the _Internal object in its declaration as
shown, or should the call to new ArrayList() be in the constructor?
2. Am I right in assuming that calling MyClass.List will in effect
return a pointer to the list?
Cheers,
Phil.
Creating a class library with an object that needs to expose a list of
other objects. Using vs 2008/.NET 3.5.
So far got this:
public class MyClass
{
private ArrayList _Internal=new ArrayList();
public ArrayList List
{
get
{
return(_Internal);
}
}
public MyClass()
{
}
}
My questions:
1. Is it correct to create the _Internal object in its declaration as
shown, or should the call to new ArrayList() be in the constructor?
2. Am I right in assuming that calling MyClass.List will in effect
return a pointer to the list?
Cheers,
Phil.