Hi all,
as we use constructor in Java to initialize variables, what exactly is the use of static and instance code blocks in java?
please also give some example which would help me understand this funda.
Thanking in advance
Regards,
vj
Printable View
Hi all,
as we use constructor in Java to initialize variables, what exactly is the use of static and instance code blocks in java?
please also give some example which would help me understand this funda.
Thanking in advance
Regards,
vj
Hi db,
the link you provided is helpful getting info regarding, what are code blocks and when they will get executed.
i have gone thru the same, what i actually wanted was a practical explanation where can it be used?
please guide,
Regards,
vj
What do you mean exactly when you say 'code block'? Are you referring to methods, such as:
Code:public void doWork()
{
//execute some code
}