Hi
we want put two main method in a single class in java its possible or not
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jan 30, 2012, 6:05 AM
1. By overloading the main() method so that each overload takes different types and/or numbers of parameters .
2. By placing an additional main() method, or overloads thereof, within a nested class of the class which contains the main() method.
Though why you'd want to do that, other than as an exercise, I cannot imagine.