+ 2

Is their any method to write 2 main functions in java

4th May 2017, 10:53 PM
pketan p
pketan p - avatar
2 Answers
+ 2
I don't believe there is a way, but you could have your program take different paths depending upon the arguments passed in. In that case you'd need some parsing and control logic in main() to walk down the correct branch.
5th May 2017, 1:35 AM
Jim
Jim - avatar
0
you can use threads if you want multiple codes to run at the same time. Check class Thread and interface Runnable
5th May 2017, 12:52 AM
Giannis Tsirovasilis
Giannis Tsirovasilis - avatar