Should a main method be compulsorily declared in all java classes?

Should a main method be compulsorily declared in all java classes?

hi,

Should a main method be compulsorily declared in all java classes?

thanks

View Answers

April 10, 2013 at 6:26 PM

Hi,

There is no need of main method be compulsorily declared in all java classes. Where as the main method we should be defined only if the source class is a java application.

For more related to main method should be compulsorily declared in all java classes

Thanks,









Related Tutorials/Questions & Answers:
Should a main method be compulsorily declared in all java classes?
What if the main() method is declared as private?
Advertisements
Can a main method be declared final?
Why is the main method declared static?
Why we should use string args[] in main method in java?
Is main method compulsory in Java?
java sleep in main method
java sleep in main method
When is java main method called?
main method
main method
main method
main method
main() method
What is the return type of the main method?
Can a method inside a Interface be declared as final?
Can a method inside a Interface be declared as final?
Main method overloading
What is the arguement of main method?
Can a main method be overloaded?
Accessing non-static members through the main method in Java.
Difference between throw and throws in java.
How to Use Java Functions In EL
JAVA what is different between static block and public static void main(String a[]) method
What is Public static void main
What is the equivalent method in Java which is equivalent to clrscr() in c/c++ . The code should help to clear the output screen ?
What is the first argument of the String array in main() method?
how to return to main menu after adding all the info. - Java Beginners
Java Method Return Value
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Till Slip Program Error Free - No Main Method
Java method Overriding
how to open one Jframe from main method call
are my declared varibles right - Java Beginners
main() syntax - Java Beginners
Can a class be declared as protected?
Finalize Method in Java
pack() vs. setSize() Method in Java
Main function.. - Java Beginners
problem with main - Java Beginners
main func - Java Beginners
Main topics in java for IT corporate working?
Method Overriding in Java
java method
Java finalize() Method Example
Java Alert Box

Ads