现在我有两个班级allmethods.cs
和caller.cs
.
我在课堂上有一些方法allmethods.cs
。我想编写代码caller.cs
以调用类中的某个方法allmethods
。
代码示例:
public class allmethods
public static void Method1()
{
// Method1
}
public static void Method2()
{
// Method2
}
class caller
{
public static void Main(string[] args)
{
// I want to write a code here to call Method2 for example from allmethods Class
}
}
我怎样才能做到这一点?