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

Give an example of use of pointers in java class.

1072


How is hashcode calculated in java?

1087


What is arrays aslist in java?

995


Explain the key functions of data binding?

1067


Why java does not support pointers?

1091


What are implicit objects in java?

1026


What is difference between string and stringbuffer?

1193


What is double checked locking in singleton?

1107


How do you insert a line break?

961


Do you need to import math in java?

1060


What is user defined exception in Java?

1132


What is stringbuffer in java?

1112


What is a concrete classes? Is Java object class is concrete class?

1026


Can a boolean be null java?

1030


What's the base class in java from which all classes are derived?

1315