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...

Is there is any error if you have multiple main methods in
the same class?

Answer Posted / srikanth

No, there is no error if we have multiple main methods
in the same class.
because, while compiling we only specify one main method
name so, the JVM compiles it by taking the main method which
is specified by us while compiling.

Is This Answer Correct ?    3 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are heterogeneous objects?

1085


What is a class component?

1220


Why we use methods in java?

1049


Can a source file contain more than one class declaration?

1056


How to pass arraylist to stored procedure in java?

1267


What is the epoch date?

1067


What is identifier with example?

1096


Is it possible to compare various strings with the help of == operator? What are the risks involved?

1128


What about main thread in java?

1172


Print Vertical traversal of a Binary Tree.

1064


What is jit and its use?

1029


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1145


How to make a class or a bean serializable?

1032


What is difference in between java class and bean?

1166


What is incompatible types in java?

1086