+ 1

Can we print anything using system.out.println without main method ? If yes then how ?

tricky interview question

30th May 2019, 3:55 PM
Shubham Mhatre
Shubham Mhatre - avatar
4 Respuestas
+ 1
The main method is necessary for the program to run bro Especially if its a command line program
30th May 2019, 4:32 PM
Owen Jay
Owen Jay - avatar
0
Main() is like u r breath if u don't breath u won't exist.
30th May 2019, 7:04 PM
Prashanth Manna
Prashanth Manna - avatar
0
You can use this example: class Static{ static{ System.out.print("Hallo!"); System.exit(0); } }
22nd Sep 2023, 4:18 PM
GOod
GOod - avatar