Horje
c# how to call methods from another class Code Example
c# how to call methods from another class
public class AllMethods
{
    public static void Method2()
    {
        // code here
    }
}

class Caller
{
    public static void Main(string[] args)
    {
        AllMethods.Method2();
    }
}
c# how to call methods from another class
// AllMethods.cs
namespace Some.Namespace
{
    public class AllMethods
    {
        public static void Method2()
        {
            // code here
        }
    }
}

// Caller.cs
using static Some.Namespace.AllMethods;

namespace Other.Namespace
{
    class Caller
    {
        public static void Main(string[] args)
        {
            Method2(); // No need to mention AllMethods here
        }
    }
}




Csharp

Related
how to make pc bsod C# Code Example how to make pc bsod C# Code Example
Change Level in Unity Code Example Change Level in Unity Code Example
basic math functions in c# Code Example basic math functions in c# Code Example
c# get enum name from value Code Example c# get enum name from value Code Example
c# list Code Example c# list Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10