I wrote the following code and noticed that only class B's main method was executing,Should not all the main methods be executing?And why only class B's why not class A's or C's?
And when i removed main methods from class A and B i got a runtime error "Main methon not foun in class B...............................................".Can anyone explain why?
Why did you expect the A method to run? Remember static methods do not override each other. Look at this FAQ.
Why did you write the import declaration? You don't appear to be using anything from the java.io package.
Yup, yup, yup. Tiny ad:
Gift giving made easy with the permaculture playing cards