A very, very simple C# question.
I want to create a normal little array of a type that is another class.
bits of the code:
class Program
{
static void Main(string[] args)
{
classA[] test;
test = new classA[2];
Console.Write(test[0].getName());
class classA
{
string name;
public classA()
{
this.name = "zup";
}
public string getName()
{
return this.name;
}
Why wont it let me ?
test[0].getName()should lead to aNullReferenceException.