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

Tell me how many ways are there to initialise an integer with a constant.

1055


Why java is not 100% object-oriented?

1431


Can constructor be protected in java?

903


What do you mean by checked exceptions?

898


Can abstract class have private constructor?

891


Why java is made?

920


What is the purpose of skeleton and stub?

1142


Can we create an object of static class in java?

969


Where is the find and replace?

939


What is compiler and what its output.

1076


What is meant by object oriented programming – oop?

922


Can static methods be inherited?

983


How does arrays sort work in java?

957


What is try-with-resources in java?

1101


Which is the best approach for creating thread ?

1136