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.

Answers were Sorted based on User's Feedback



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

Answer / ganesh slv

Sorry for all my answers above.. I misunderstood lot of things.

Is This Answer Correct ?    0 Yes 0 No

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

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

More Core Java Interview Questions

What are the benefits of operations?

0 Answers  


What is the use of static methods?

0 Answers  


Can you call a private data from an inner class?

6 Answers  


How do you relate a Interface to a Class? Tell me in Detail?

4 Answers  


Can a class have more than one object?

0 Answers  


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

0 Answers   Infosys,


What is Vector?Can you elaborate how Vector is Thread safe?

3 Answers   HCL,


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread

0 Answers  


Does list maintain insertion order java?

0 Answers  


Does java allow overriding static methods ?

0 Answers  


what is Assertion?

4 Answers   Wipro,


Define interface?

3 Answers   MindCracker,


Categories