+ 2

why is the static block executed before the main method in java?

for instance: class A{ static{ //👈 system.out.print(1); } public static void main(String[] args){ sytem.out.print(2); } } //output is 12

16th Dec 2019, 10:24 PM
Umar Idris
Umar Idris - avatar
0 ответов