Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Why does java not allow multiple public classes in a java file ?

Answer Posted / sushila sonare

suppose in java file so many classes, interfaces, abstract
classes and enumerations are there. we can keep only one of
them as a public because its shown a container and this
container we are keeping all things in our java file.

if we kept public for more then one class then all are that
classes qualified as a container or we are called it
execution unit. again compiler get confuse which container
classes has to kept. So avoiding this confusion multiple
public classes are not allowed in java.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of using java.lang.class class?

1016


Which sorting is used in arrays sort in java?

1080


What are the main features of java?

972


Describe the Big-O Notation.

1048


How can we avoid including a header more than once?

1040


What is considered an anti pattern?

932


What is time complexity java?

991


What are the four corner stones of oop?

1037


Is a case study a method or methodology?

898


What is java util collection?

1089


What is the abstract class?

1028


What is a function argument in java?

997


Is node a data type in java?

1004


What are thread local variables?

1152


What is the use of System class?

1162