ProAnswers.org

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

No not required. main() method should be defined only if the source class is a java application.