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 is daemon thread and which method is used to create the daemon thread? : Java thread

0 Answers  


What variables are stored in stack?

0 Answers  


1.what is the exact difference between applet and frame? 2.Do we use main method in frames?

5 Answers  


How do you define a set in java?

0 Answers  


What is difference between Heap and Stack Memory?

0 Answers  


Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.

0 Answers  


what is the use of reference variable

6 Answers  


What does the “final” keyword mean in front of a variable? A method? A class?

0 Answers  


What is the difference between access specifiers and access modifiers in java?

0 Answers  


Explain about exception propagation?

0 Answers  


how to print the below in java? * * * * * * * * *

2 Answers  


What is difference between hashset and hashmap?

0 Answers  


Categories