If a class has inheritance in a Java program, do I need to put main method in the superclass or subclass? Many programs put the main method in different positions. Can anybody tell me how to do that? Thanks a lot!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think it might be best to have a simple class whose sole dedicated purpose is to contain the
static mainmethod. It simple and clear.Your main method would then get things started by creating the initial objects from your program.