0
Can we call main method explicitly?
public static void main is called by jvm.
3 Antworten
+ 2
It's a static method like any other, so once the program is executing you can call another main method using a static call (i.e. Class.main() )
+ 1
public class Program
{
static int x = 0;
public static void main(String[] args) {
if (x < 20) {
x++;
main(args);
} else
System.out.println(x);
}
}
0
Yes, anyone know how?