c# create two class instances with error

  • Thread starter Thread starter wonglihuang
  • Start date Start date
W

wonglihuang

Guest
Hello,

I want to create two class instances , but there is an error.


class Animal
{
public static void testFun(string str)
{
Console.WriteLine(str);
Console.ReadLine();
}
}

class Program
{
static void Main(string[] args)
{
Animal animalA = new Animal();
Animal animalB = new Animal();

AnimalA.testFun("aaaaaaa");
AnimalB.testFun("bbbbbbb");
}
}

Continue reading...
 
Back
Top