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

Can we have more than one package statement in the source file?

1029


Explain treeset?

1060


What is the different between get and post?

919


Why do we need variables?

937


Can we pass null as argument in java?

905


What is generic type?

986


What is Recursion Function?

1141


Explain about the security aspect of java?

931


What are different type of exceptions in java?

930


How can you set the applet size?

1010


Can we assign the reference to this variable?

934


Is an object null?

921


Is a string literal?

1025


Why is java so important?

1075


what is a working thread? : Java thread

1002