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

Why only one Class is public in one file? Explain in
details. Thanks in Advance.

Answer Posted / gopi

The class main method is start with public . This is
starting of the program, compiler have to know where to
start the program to compile. so only one public is there to
avoid confusion. We also use the public method to interact
with the out side of the programs. Without using of the
public class it can't possible to interact.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is list ordered in java?

921


Why deletion in linkedlist is fast than arraylist?

1024


Explain serialization and deserialization in java?

939


What is java util list?

876


What are the types of inner classes (non-static nested class) used in java?

1010


Explain the init method?

920


What is fail first in java?

1079


What is a local block?

1069


What is internal variable?

964


Is java a pure object oriented language?

911


What is the final keyword denotes?

1052


Is string pool garbage collected?

949


What is return type in java?

1010


Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

990


What is the difference between static and non-static variables in java programming?

913