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 anonymous class in java?
What is meant by string is immutable?
Can we store variables in local blocks?
What is array command?
What is the difference between post and put?
Explain importance of finally block in java?
What is the base class for error and exception?
Difference between serialization and deserialization in java?
Explain abstract class in java?
What is data structure in java?
What is the difference between the boolean & operator and the && operator in java programming?
What is the difference between declaration and definition in java?
What is meant by method overriding?
What are the changes in java.io in java 8 ?
What is sorting in java?