> static initializers java ~ Online tutorial

static initializers java

Static Initializers
Any static initializers declared in a class are executed when the class is initialized
and, together with any field initializers for class variables, may be used to
initialize the class variable of the class
StaticInitializer:
static Block
  • It is a compile-time error for a static initializer to be able to complete abruptly
    with a checked exception .
  • It is a compile-time error if a
    static initializer cannot complete normally
  • The static initializers and class variable initializers are executed in textual
    order.
  • Use of class variables whose declarations appear textually after the use is  sometimes restricted, even though these class variables are in scope.

  • If a return statement appears anywhere within a static initializer,
    then a compile-time error occurs.

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: