+ 1
Can we print anything using system.out.println without main method ? If yes then how ?
tricky interview question
4 Antworten
+ 1
The main method is necessary for the program to run bro
Especially if its a command line program
0
Main() is like u r breath if u don't breath u won't exist.
0
You can use this example:
class Static{
static{
System.out.print("Hallo!");
System.exit(0);
}
}