Search
 
SCRIPT & CODE EXAMPLE
 

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");
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: set gamemode of player spigot 
Java :: compress a directory in java 
Java :: how to run few methods of class after mockStatic 
Java :: android java show hide keyboard in AndroidManifest 
Java :: convert base64 to pdf object for pdf reader in android studio 
Java :: how to store date in java 
Java :: reader from string java 
Java :: export java path in ubuntu 
Java :: java empty arraylist 
Java :: how to hash string in java 
Java :: java selection sort 
Java :: put arraylist in hashtable java 
Java :: java list newline 
Java :: show all spring boot beans 
Java :: string to pojo java 
Java :: exception in java 
Java :: Create EntityManager Hibernate 
Java :: multiple representations of the same entity are being merged 
Java :: permutation and combination program in java 
Java :: initialize empty dictionary java 
Java :: djava days between two dates 
Java :: abstract class java constructor 
Java :: fragment call activity 
Java :: how to print array in one line in java 
Java :: json java 
Java :: list interface java 
Java :: java collectors mapping 
Java :: create a string in java 
Java :: how to create a java txt file from programm 
Java :: java inheritance example 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =