how to call static method inside non static method in c#

前端 未结 4 947
隐瞒了意图╮
隐瞒了意图╮ 2021-01-24 05:58

how to call static method inside non static method in c# ?

Interviewer gave me scenario :

class class1
{

    pub         


        
4条回答
  •  耶瑟儿~
    2021-01-24 06:41

    You type the method name out, and then compile and run it:

    class class1
    {
        public static void method1(){}
    
        public void method2()
        {
            method1()
        }
    }
    

提交回复
热议问题