You can also try this, make two other classes (of course, not public) in the same file. Write main method with exact signature in all the three classes. Write some code inside three main methods, compile and execute. Check which main method is executed. You didnt get what I meant?
then check this :-