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...

can two class in a code be public??if yes then how??

Answer Posted / sreejesh1987

One java source file must have only one top-level(top level means not an inner class) public class with the same name as the name of the source file .


You can have inner classes to a class which are public. Hence in this way it is possible to have more than one public class in a single file.

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to declare objects of a class ?

1076


What is the difference between JDK and JVM?

1270


What about method local inner classes or local inner classes in java?

1055


What is an array in java?

1197


What is factor r?

963


What does indexof return in java?

990


Is array dynamic in java?

932


What is the main functionality of the remote reference layer?

1999


What is fundamental datatype?

998


What is a pattern what is an anti pattern?

973


What does super keyword do?

1073


Are true and false keywords?

1026


What is the char data type?

997


What is the default value of byte datatype in java?

935


What are packages in java?

1644