Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


if try is followed by finally block what happen to exception
occured in try block

Answers were Sorted based on User's Feedback



if try is followed by finally block what happen to exception occured in try block..

Answer / yogita

Finally block wil anyways gets executed bcoz it meant to be
executed even the error occurs.
And, error wil also occur since purpose of catch block is
to handle the exception occured in try block and present it
to user in a user friendly manner. If error has not been
handled in catch block, it will stil show the system error
msg(not the user understandable messgae what we generally
do)

Is This Answer Correct ?    11 Yes 1 No

if try is followed by finally block what happen to exception occured in try block..

Answer / solanki_mca

well, in this case you have not written any code to handle
Exception so u will get exception in the form of error.

Because if any exception occurs in try block control(run
time environment) searches for its corresponding catch
block, and if it will not found any it will raise the error
and control willl not be able to reach inside finally block
so code written inside will not be executed.

class abc
{
public static void Main(String[] args)
{
try
{
// some code here which cause erorr.
}

finally
{
// control will not come inside
// code to clean up system resources.

}
}


Even if u write catch block which does not belongs to
particular exception that has occured, in this case also
you will get error.

So if you are not sure about kind of exception that could
be occured; implement catch block which catches any kind of
exception as below.


class abc
{

try
{
// some code that will raise ArrayIndexOutOfBound xception
}

catch(ArithmeticException ex1)
{
// some code
}

catch(Exception err)
{
// code that will be handle to any kind of exception
}

finally
{
// clean up code
}
}

Regards,
Hitesh

Is This Answer Correct ?    7 Yes 4 No

if try is followed by finally block what happen to exception occured in try block..

Answer / raju

error occurs

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More Programming Languages AllOther Interview Questions

why we need to take u?

0 Answers  


How to print No.of.rows affected after updation using ADO.Net

0 Answers   Tech Mahindra,


What is diffrent between Method and and function in c#

0 Answers  


what is class module in vb6? what it's use? with example..

0 Answers  


what is difference between sap and java ?

1 Answers  


When will you use shell script/Perl ahead of C/C++?

0 Answers   Yahoo,


how do u handle table control inbdc explain the process in steps iwant the answer in urgent please forward this even i know how to explain there

0 Answers   Synopsis,


What is the difference between save and create method of activerecord?

0 Answers  


public static void main(String args[]) describe it

0 Answers  


What is abstract Method i want the exact definition and is there any possibility to declare class as abstract without any abstract methods in that class?If it is possible then tell me why and how?

0 Answers  


Hey this is venkatesh.Please can any body tell me what is SFLNXTCHG?where we use this keyword?what perpuse we use this?Can you tell me in real time senario with example? And in 7 specification(RPG/400)what is the mandatory specification using programs?

0 Answers  


what are importance in problem tracking

0 Answers  


Categories