Let us first try to understand this Java interview question. You can see below
is a simple Java code which where in we have put a return statement in the try
block. So the question is will finally block execute.
public static void main(String[]
args)
{
try
{
int i=0;
return;
}
finally
{
// will the
control come here
int z=0;
}
}
The answer is Yes Finally block will execute irrespective
there is return or there are no return statements. That’s why finally block is
the best place to put clean up code.
You can also see our Java j2ee interview question and answer video: - what is service locator?
Company cleaning boards in Hail
ReplyDeleteSwimming pool cleaning company in Hail
Tank cleaning company in Hail
A carpet cleaning company in Hail
Hail Cleaning Company
Pest control company in Hail
A sofa cleaning company in Hail
ReplyDeletevery nice blogs!!! i have to learning for lot of information for this sites.Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing
Horizontal Asymptote
utsa blackboard
Special Right Triangles
Perfect Square Trinomial Formula