Uninitialized Values
/*
Learning C#
by Jesse Liberty
Publisher: O'Reilly
ISBN: 0596003765
*/
// with compile error
public class UninitializedValues
{
static void Main( )
{
int myInt;
System.Console.WriteLine
("Uninitialized, myInt: {0}",myInt);
myInt = 5;
System.Console.WriteLine("Assigned, myInt: {0}", myInt);
}
}
Related examples in the same category