0
The second Line of code, why we put i=5; between {}?
Public class prog{ Static { i=5;} Static int i; Public static void main (String[] args){ System.out.println(i); } }
4 ответов
+ 2
Hichem GOUIA That's call as static block where you can initialize multiple variable.
+ 1
You could have just wrote-
static int i = 5;
But you have initialized it through a static block. Both means the same.
+ 1
Thanks my Friends😊