How to call a method from another class directly in c#

1 Answer

0 votes
using System;

namespace ConsoleApplication1
{
    public class class1
    {
        public static void Method1()
        {
            Console.WriteLine("Method1");
        }
    }
    public class Program
    {
        static void Main(string[] args)
        {
            class1.Method1();
        }
    }
}

/*
run:
   
Method1
      
*/

 



answered Apr 22, 2017 by avibootz

Related questions

1 answer 155 views
1 answer 157 views
1 answer 223 views
1 answer 197 views
1 answer 210 views
...