| Share this post! | Vote this! |
|
An initialization block is a block of code between braces that is
executed before the object of the class is created. As the execution of
the initialization block is dependent on the creation of the object we
can easily make a guess that it has two types of object.
1. Non static initialization block.It is dependent on the object and the initialization block is executed for each object of the class that is created. It can initialize instance member variables of the class. Here is a simple example. more...
1. Non static initialization block.It is dependent on the object and the initialization block is executed for each object of the class that is created. It can initialize instance member variables of the class. Here is a simple example. more...




0 comments:
Post a Comment