0

Why is it that the static block executes first in java

java

23rd Feb 2018, 6:54 AM
Basavaraj Rajashekhar Patil
Basavaraj Rajashekhar Patil - avatar
2 Respostas
+ 4
If I underatand your question well, you ask why static runs before non-static? Everything that is static has to run when the class is loaded in to memory, since it is part of the class itself. Where everything non-static is part of the class its instance. (when you use the "new" keyword)
26th Feb 2018, 8:08 AM
Faust Aelurus
Faust Aelurus - avatar
0
thanks !
26th Feb 2018, 9:19 AM
Basavaraj Rajashekhar Patil
Basavaraj Rajashekhar Patil - avatar