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

Which class is used by server applications to obtain a port and listen for client requests?

902


What are encapsulation, inheritance and polymorphism?

941


What is the best definition for data?

920


What is fundamental datatype?

937


How do you check if a number is a perfect square?

934


Can a hashset contain duplicates java?

918


How is hashset defined in java?

958


Difference between collection, collection and collections in java?

953


Can we execute a program without main?

960


Which class is the superclass for all the classes?

970


Why java is considered as platform independent?

962


What are the differences between heap and stack memory in java?

994


Explain about the interpreter in java?

989


Describe different states of a thread.

939


What is stack example?

952