-
public class Main {
-
private double main= 54.42;
-
public Main() { }
-
public static void main(String[] args) {
-
Main main= new Main();
-
main.main();
-
main.main(42);
-
main("can");
-
}
-
private void main() { System.out.print("yes "); }
-
private void main(int i) { System.out.print("you "); }
-
private static void main(String s) { System.out.println(s); }
-
}
-
kind regards,
Jos
1.) Why would you want 2 main functions? Are you trying to implement multithreading or something?
2.) Would you even consider that a main function: private static void main(String s) { System.out.println(s); } ? You are just overloading the main function, nothing more. The difference between a real main function and that overloaded imposter is: the program points and knows to point at the real main function. ... Am I making sense?
3.) That was really cute though.
To answer the poster's question. If you mean a method where the program starts, how can a program start at 2 different places? My answer would be no.