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

What is compareto?

1012


What is quick sort in java?

986


What happens if a constructor is declared private?

1010


What is double checked locking in singleton?

1033


What is a singleton factory?

947


What is getkey () in java?

982


What is garbage collection? What is the process that is responsible for doing that in java?

1085


What is communist flag?

997


Compare Mutex and Semaphore in java.

988


Can you tell me range of byte?

971


Can you override static methods?

945


How do constructors use this() and super()?

1093


Why are the methods of the math class static?

1057


What is the difference between replace and replace all?

1000


How to remove the trailing spaces from a string?

1248