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

State some advantages of java?

1244


How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?

1018


How many bytes is string in java?

1257


How many return statement are allowed in a function?

937


What is difference between static and abstract class?

1005


What is static variable with example?

1016


Can we override the overloaded method?

1149


List the interfaces which extends collection interface?

958


What is consumer interface?

1004


What is final variable?

949


What does string intern() method do?

1089


Why is the main method declared static?

1141


What is a war file?

1086


Where are register variables stored?

1018


Where local and global variables are stored?

1085