+ 1
How can we write multiple main functions in JAVA?
can a java program contain multiple main in what context we can use them?
3 Answers
+ 9
Check this out.
https://code.sololearn.com/cjaInE3bgRqx/?ref=app
+ 5
tl;dr - Yes, either through overloading, or by having multiple classes each with one main function in it.
https://www.quora.com/Can-a-Java-program-contain-more-than-one-main-method-in-a-class
+ 1
Either by Overloading or not in only one class. But you can use Threads for some kind of 2 works with one main method