New course! Every coder should learn Generative AI!
Try a free lesson+ 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
0 Answers