ContactUs :

Please send your Questions & Answers or Feedback to "mohan@javabook.org"

What are static Initializers?

A static initializer block resembles a method with no name, no arguments, and no return type. There is no need to refer to it from outside the class definition.

 

Syntax:

static

{

  //CODE

}

The code in a static initializer block is executed by the virtual machine when the class is loaded.

Because it is executed automatically when the class is loaded, parameters don't make any sense, so a static initializer block doesn't have an argument list.

 

Related Posts Plugin for WordPress, Blogger...
Flag Counter