Answers for "do you need a main method in java if you have a static method"

0

can you run non static method on main

//You simply need to create an instance of the Object you created
public Class Obj{
	public void nonStaticMethod(){
	//execute code
	}
	public static void main(string args[]){
		Obj obj = new Obj();
	    obj.nonStaticMethod
	}
}
Posted by: Guest on June-01-2020

Code answers related to "do you need a main method in java if you have a static method"

Browse Popular Code Answers by Language