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 / madan

public static void main(String args[])

this is command line args.. we need to declare public because, this is the main method, from any class, any package, we have to call, so it will be public.. same as class is also public...suppose, if u declare two class as public, it show error, we have to save a file somefile.java...

i think u understood based on above explanation..

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do I need java on my pc?

1045


Can an integer be null java?

1006


What is difference between final and finally in java?

1079


Explain the selection sort algorithm?

1055


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

1084


What are decalarations?

1122


Explain the difference between comparator and comparable in java?

944


Is ++ operator is thread safe in java?

955


Can a class have multiple constructors?

1046


What does math floor () do?

960


What's the difference between an abstract class and interface in java?

1030


Which non-unicode letter characters may be used as the first character of an identifier?

1007


Are arrays classes in java?

1034


Is there is any difference between a scrollbar and a scrollpane?

990


What is the difference between C++ and Java and your preferences?

1110