N
nick_nw
Given:
class MyClass
{
private int var;
public MyClass ()
{
// Any old init code
var = 3;
}
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
MyClass [] array = new MyClass [14];
}
}
What actually happens when new is called? I've looked at the IL and it
seems that the newarr command is called. I've not been any detailed
info on newarr and what it actually does.
The constructor in MyClass is not called so no instances of MyClass are
created. What is new actually doing?
Thanks in advance,
Nick
class MyClass
{
private int var;
public MyClass ()
{
// Any old init code
var = 3;
}
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
MyClass [] array = new MyClass [14];
}
}
What actually happens when new is called? I've looked at the IL and it
seems that the newarr command is called. I've not been any detailed
info on newarr and what it actually does.
The constructor in MyClass is not called so no instances of MyClass are
created. What is new actually doing?
Thanks in advance,
Nick