Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to call a non static method

class Program {
    public static void Main(string[] args) {
        Program p = new Program();
        p.TestMethod();
        staticFunction();
    }
    public void TestMethod() {
        Console.WriteLine("Inside non-static function");
    }
    public static void staticFunction() {
        Console.WriteLine("Inside static function");
    }
}
Source by www.c-sharpcorner.com #
 
PREVIOUS NEXT
Tagged: #call #static #method
ADD COMMENT
Topic
Name
8+6 =