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 we write a goto or a return statement in try and catch
block will the finally block execute?

Answers were Sorted based on User's Feedback



If we write a goto or a return statement in try and catch block will the finally block execute?..

Answer / hhh

yes

Is This Answer Correct ?    15 Yes 3 No

If we write a goto or a return statement in try and catch block will the finally block execute?..

Answer / om namo bagavathe vasudevaya n

what ever goto or continue statement you used in try/catch
the finally bolck must be executed

even an exception occuerd or an exception not occured in the
try block the finally block defanetly executed

but they are some excptions like system exceptions and
application exceptions.For this exceptions the finally block
may or may not excute because

SYSTEM EXCEPTIONS:this excptions occur during runtime
examples:some hardware problems

Application Exception:they also probally occur whill the
application is running

example:if we give textbox maximum size limt as 50
characters.If we enter morethan 50 characters then some
exceptions should occur

Is This Answer Correct ?    13 Yes 2 No

If we write a goto or a return statement in try and catch block will the finally block execute?..

Answer / guest

yes, whatever may be the content of the try-catch blocks,
the finally block is going to execute

Is This Answer Correct ?    11 Yes 2 No

If we write a goto or a return statement in try and catch block will the finally block execute?..

Answer / uday

The statements after goto in try block wont be executed.
And Finally block also get executed.
static void Main(string[] args)
{
int a, b,c;
a = 10;
b = 0;
try
{
goto A;
c = a + b;
Console.WriteLine(c);
}
catch (Exception e)
{
Console.WriteLine("In parent exception Catch" +
e.Message);
}
finally
{
Console.WriteLine("In finally block");
}

A:
Console.WriteLine("at goto label");

Console.Read();

}

The output is:
In finally block
at goto label

Is This Answer Correct ?    2 Yes 0 No

If we write a goto or a return statement in try and catch block will the finally block execute?..

Answer / kanan

Yes.

Is This Answer Correct ?    1 Yes 0 No

If we write a goto or a return statement in try and catch block will the finally block execute?..

Answer / kranthi

Yes..irrespecitve of writing goto or return or exception
occured, finally block will execute.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Define Final Class in C#

0 Answers   HCL,


What is overriding in c#?

0 Answers  


What are three test cases you should go through in unit testing?

1 Answers   Siebel Systems, Wipro,


How are Windows programs different from normal C-programs?

0 Answers   Tech Mahindra,


Where are all .NET Collection classes located ?

8 Answers   TCS,


Explain how to parse a datetime string?

0 Answers  


Difference between directcast and ctype.

0 Answers  


What is the difference between const and static read-only?

0 Answers  


What does writeline mean?

0 Answers  


What is Abstraction?

8 Answers   Google, HCL, IBM, MAHINDRA, Tech Mahindra,


what is the equivalent to regsvr32 and regsvr32 /u a file in .net development?

0 Answers   4Cplus,


What is global asax in c#?

0 Answers  


Categories