Wednesday 28 August 2013

Use of IIB , SIB , Constructor Overloading

in previous articles we saw IIB , SIB and constructors.
SIB executes only one time throughout the whole execution of the program.
Execution of IIB and Constructor depends on the object creation.

SIB has more priority than IIB.
IIB has more priority than Constructor.

Example:-


first SIB prints then IIB after this Constructor.

Example:-


 here we create 2 object of the class we see that SIB print only one time and IIB print 2 times and same about constructor.

Example:-


in this we use constructor overloading....................



No comments :

Post a Comment