Class XYZ{ public static void functionTest(){ // Your code } public static void main(String args[]){ XYZ x = new XYZ(); //Here we can execute the method functionTest() in 2 ways. x.functionTest(); XYZ.functionTest(); } }
Class XYZ{ public static void functionTest(){ // Your code } public static void main(String args[]){ XYZ x = new XYZ(); //Here we can execute the method functionTest() in 2 ways. x.functionTest(); XYZ.functionTest(); } }