If you are writing a program in java then you have to put main method in a class, so that class is the owner of main method but since we r declaring it as public it is available to all class ,and also you have to use the modifier STATIC so the JVM can access the method without creating the class object of that class.
RE: Every application should have a main() method. Under which class does the main() method comes under?
It may not required to put the main method in the public class. But we have to save the file with the public class name. So it is preferrable to put the main() method in the public class. Other wise we need to remember in which class you put the main method and need to give that class name while running.
RE: Every application should have a main() method. Under which class does the main() method comes under?
Even if you dont have main method we can develop program like public class{ static { System.out.println( Hello world ); System.exit(0); } } this will execute without errors
RE: Every application should have a main() method. Under which class does the main() method comes under?
If you are writing a program in java then you have to put main method in a class so that class is the owner of main method but since we r declaring it as public it is available to all class and also you have to use the modifier STATIC so the JVM can access the method without creating the class object of that class.
RE: Every application should have a main() method. Under which class does the main() method comes under?
main() method should be present in the java class which we execute at the command prompt. for example. c:/> java abc where abc is the class which must have a main() method because JVM calls the main method of this class after it loads all the classes into its memory.