Answers for "java static section"

0

static initializer

Static blocks or static initializers are used to initalize static fields in java 
we declare static blocks when we
want to intialize static fields in our class. 
Static blocks gets executed exactly once when the class is loaded
Static blocks are executed even before the constructors are executed.
Posted by: Guest on November-30-2020
-1

What is the static block

Static block is used to initialize the static data member. 
It is executed before the main method, 
at the time of classloading.
Posted by: Guest on November-28-2020

Browse Popular Code Answers by Language