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


Please Help Members By Posting Answers For Below Questions

Difference between stack and queue?

821


What is the use of http-tunneling in rmi?

820


Can we restart a thread already started in java?

858


What is flag in python?

833


What are heap memory and stack memory and what are memory tables.

746


Explain the different forms of polymorphism?

786


Can we increase size of array?

784


How do you create a method in java?

763


Can we override data members in java?

904


How will you reverse a singly-link list?

788


What are the three parts of a lambda expression? What is the type of lambda expression?

825


What is the latest java version?

819


What is a dot notation?

785


what state does a thread enter when it terminates its processing? : Java thread

837


Which is better 64 bit or 32 bit?

711