Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# how to call a method from another class

 class A
    {
        public void TestCallingMethod()
        {
            /*to call a method in the same class*/
            Method_A();


            /*to call a method in another public class*/
            B b_object = new B();
            b_object.Method_B();
          
        }
        public void Method_A()
        { }
    }

    class B
    {
        public void Method_B()
        { }
    }
 
PREVIOUS NEXT
Tagged: #call #method #class
ADD COMMENT
Topic
Name
8+3 =