defining class. If you attempt to make use of nonstatic class data or call a nonstatic method of the class within a
Like
any static member, to call Complain(), prefix the name of the defining class:
static void Main(string[] args)
{
Console.WriteLine("***** Fun with Static Methods *****\n");
for(int i =0; i < 5; i++)
Console.WriteLine(Teenager.Complain());
Console.ReadLine();
}
Do'stlaringiz bilan baham: