Why does java not allow multiple public classes in a java file ?
Answer Posted / rahul
java does not support multiple public classes because of there are only one main method to define......and we can not have multiple main methods in a same class....and we know that java code will always save as the name of class name in which main method are define......
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
What is volatile keyword in java
Why string is immutable or final in java
Is it possible for a yielded thread to get chance for its execution again?
Can we overload the constructors?
What will be the output of round(3.7) and ceil(3.7)?
Why do we need autoboxing in java?
What is the finalize method do?
What does void * mean?
can I implement my own start() method? : Java thread
Can we have return statement in finally clause? What will happen?
Is 0 an irrational number?
What is the use of keywords in java?
What are operators and its types?
Explain wrapper classes in java?
Why do we override tostring method in java?