this keyword in Java

“this” is a reference to the current object within the instance method or constructor. Current object means the object which has called the method or the constructor. We can say “this” is a keyword which holds the address of the current object. We can use “this” to call any member of the current object. Compiler […]

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 >