Compiler code

When we write a program in Java, we know that it gets converted to byte code, but before that compiler adds some intelligent code into our code. Let’s see what compiler will add 1) Extends Object class to our class 2) Default constructor if there are no constructor defined for a class 3) Adds this […]

Share this article on

SIB,IIB and Examples on SIB and IIB

SIB – Static Initialization Block SIB executes when the class gets loaded and executes only once in entire execution IIB – Instance Initialization Block IIB executes when the constructor is called but before the execution of constructor. So it executes as many times as constructor gets executed. Let’s see the example package com.kb.instanceblock;   public […]

Share this article on
< Previous Next >