+ 2

Is possible to run java program using static block but without using main function

java

30th Nov 2017, 2:09 PM
Deepan
3 Answers
+ 7
Code in the "static" block runs before main(). An empty/non-empty main() function must be defined though.
30th Nov 2017, 2:21 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
0
Yes its possible
21st Aug 2020, 3:14 PM
Rohit Singhal
Rohit Singhal - avatar
0
In older version of jdk....
21st Aug 2020, 3:15 PM
Rohit Singhal
Rohit Singhal - avatar