How to call a method of class1.cs in class2.cs

Dec 14 2004 6:43 AM
Suppose there is console application in which there is a file Class1.cs.Some code is present by default. I add another Class2.cs file. I write the following code in Class2.cs file: using System; class Class2 { public void func() { Console.WriteLine("hi"); } } How to use method func of class2 in class1.cs file under Main(). Moreover, Build action property of class2.cs should be set to ?????

Answers (1)