This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Because the class that has the main method has to be accessible from the outside.
Joined: Jan 12, 2010
Thanks a lot friends for patiently replying to all my naieve questions.
Just one final question.
Tell me which of my understanding is true :
1)one java file can have as many classes as we want but only one class can be public and that should have main method also the name of the java file will be the name of the public class ie the class which has main.
2)one java file can have as many classes as we want and also as many public classes as we want and out of these public classes one should hav the "main" and the name of the java file will be the nameof the public class having main ().