Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

IIB AND SIB

IIB And SIB

IIB(Instance Initialization block):-

 Instance Initialization block is used to Initialize the instance data member as well as static variable. It run each time when object of the class is created.It run before the main method of program .

syntex:-

{

 //your code here...

}

ex:-


SIB(Static Initialization block):-

 Static Initialization block is used to only to initialize the static data member. It run only once time and not need to create object of the class.It run before the main method of program .

syntex:-

static

{

//your code here...

ex:-

 

 


 

 


 

 



This post first appeared on BCA MCA NOTES, please read the originial post: here

Subscribe to Bca Mca Notes

Get updates delivered right to your inbox!

Thank you for your subscription

×