Answers for "how to call a non static method"

0

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");
    }
}
Posted by: Guest on December-29-2021

Code answers related to "how to call a non static method"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language