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
Difference between == and .equals() ?
Can a class have multiple subclasses?
What is definition and declaration?
What is lambda programming?
How can we find the sum of two linked lists using stack in java?
Explain the difference between an Interface and an Abstract class?
How to split a string in java?
Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.
How is the marker interface used in Java?
What is the difference between an if statement and a switch statement?
Write a program to find the whether a number is an Armstrong number or not?
Is singleton class immutable?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
What is javac used for?
What is boolean data type in java?