+ 1

java class and main method.

in java, why main method shud be outside class and shud be used from another class? explain in simple language .. if possible, give example from real world..

5th Feb 2018, 7:56 AM
Akshit Kukkar
Akshit Kukkar - avatar
2 odpowiedzi
+ 17
u can use it from the the same class also //make only 1 class
5th Feb 2018, 11:17 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
its our choice to use main in outside class.
5th Feb 2018, 10:51 AM
Mohd Zaki
Mohd Zaki - avatar