+ 2

How to call function without creating object in java ?

please give code

22nd Oct 2017, 5:28 AM
raju 3486
raju 3486 - avatar
2 Antworten
+ 21
//use static keyword while defining the function public class Program { public static void func() {} public static void main(String[] args) { func(); // method call } static void func () {statement (s);} //method definition } //hope u got it buddy ☺ & mark john sir answer as best , i derived answer from him only
22nd Oct 2017, 6:03 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
public class Program { public static void func() {} public static void main(String[] args) { func(); // Calling function } }
22nd Oct 2017, 5:41 AM
John Wells
John Wells - avatar