T
Tony Johansson
Hi!
The variable myInstanceInt in class Foo below is automaticaly initialized to
0 because the implicit constructor that is called.
class Foo
{
int myInstanceInt;
public void MyMethod()
{
int myLocalInt;
Console.WriteLine(myLocalInt);
}
}
The local variable myLocalInt in method MyMethod is not automaticaly
initialized becuase if this valiable is not exlicit
initialized I get compile error when I try to write it's value as in this
statement Console.WriteLine(myLocalInt);
I mean when instance value type like myInstanceInt above is automaticaly
initialized why is not
the local valiable myLocalInt in the method automaticaly initialized ?
//Tony
The variable myInstanceInt in class Foo below is automaticaly initialized to
0 because the implicit constructor that is called.
class Foo
{
int myInstanceInt;
public void MyMethod()
{
int myLocalInt;
Console.WriteLine(myLocalInt);
}
}
The local variable myLocalInt in method MyMethod is not automaticaly
initialized becuase if this valiable is not exlicit
initialized I get compile error when I try to write it's value as in this
statement Console.WriteLine(myLocalInt);
I mean when instance value type like myInstanceInt above is automaticaly
initialized why is not
the local valiable myLocalInt in the method automaticaly initialized ?
//Tony