GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  C#
Go To First  |  Previous Question  |  Next Question 
 C#  |  Question 83 of 436    Print  
Will finally block get executed if the exception had not occurred?
Yes. What is the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?


  
Total Answers and Comments: 2 Last Update: August 04, 2008   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 12, 2005 09:28:39   #1  
sahu Member Since: December 2005   Contribution: 323    

RE: Will finally block get executed if the exception h...

Ans:

Yes


 
Is this answer useful? Yes | No
August 04, 2008 03:49:00   #2  
srinath1826 Member Since: July 2008   Contribution: 1    

RE: Will finally block get executed if the exception had not occurred?
Yes the final block gets executed the order of the execution is:Try block Catch block and Finally block.
 
Is this answer useful? Yes | No

 Related Questions

You want the lock statement, which is the same as Monitor Enter/Exit: lock(obj) {// code}translates to: try {CriticalSection.Enter(obj);// code} finally {CriticalSection.Exit(obj);}  
Latest Answer : A thread is simply a separate stream of execution that takes place simultaneously with and independently of everything else that might be happening. A thread can synchronize itself with another thread waiting for it to complete.The System.Threading.Thread ...

The easiest way is to use goto: using System;class BreakExample {public static void Main(String[] args) {for(int i=0; i 
Latest Answer : Yes, there are ways to break out of nested loops.  Although GOTO is allowed in C#, it is normally a bad idea, bad style, and indication of lack of good software development foundation of those who use it (no offense intended).Here are a couple of ...

Yes. The code in the finally always runs. If you return out of the try block, or even if you do a "goto" out of the try, the finally block always runs, as shown in the following example: using 
Latest Answer : Ans:Yes ...

Yes. Try-catch-finally blocks are supported by the C# compiler. Here's an example of a try-catch-finally block: using System;public class TryTest{static void Main(){try{Console.WriteLine("In 
Latest Answer : Ans:yes ...

The following is a response from a developer on the C# compiler team: We get rid of unused locals (i.e., locals that are never read, even if assigned).We get rid of unreachable code.We get rid of try-catch 

Some security exceptions are thrown if you are working on a network share. There are some parts of the frameworks that will not run if being run off a share (roaming profile, mapped drives, etc.). To see 
Latest Answer : ans:Yes,this is right. ...

If you try to instantiate the class inside the try, it'll be out of scope when you try to access it from the catch block. A way to get around this is to do the following: Connection conn = null; try 
Latest Answer : ans:Answer: If you try to instantiate the class inside the try, it'll be out of scope when you try to access it from the catch block. A way to get around this is to do the following: Connection conn = null; try {conn = new Connection();conn.Open();}finally{ ...

Yes. What is the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?  
Latest Answer : Yes, the final block gets executed the order of the execution is:Try block, Catch block and Finally block. ...

No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.  
Latest Answer : No: only one catch block will be executed for an exception. We can write several catch blocks below a try block. When an exception generates all these catch blocks will be scanned sequentially for a matching exception type. It is advised to write catch ...

Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).  
Latest Answer : Ans:Yes,It is corect.Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly). ...


 Sponsored Links

 
Related Articles

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

JavaScript Exception Handling – Part II

JavaScript Exception Handling Part II In this JavaScript tutorial you will learn about exception handling viz try… catch finally statement and nested try… catch statements along with syntax and examples mosgoogle center try… catch finally Statement JavaScript has a
 

JavaScript Exception Handling – Part I

JavaScript Exception Handling Part I In this JavaScript tutorial you will learn about Exception Handling Catching errors in JavaScript Using try catch statement and throw in JavaScript along with syntax and examples mosgoogle center It is impossible for a programmer to write a program without erro
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

HR Interview - Behavioral HR Interviews

Behavioral HR Interviews As the name implies a behavioral interview is an interview that is held by a human resources department to determine if an applicant has the behaviors that are appropriate for a job The company must know how an applicant will behave in a certain situations mosgoogle The logi
 

HR Interview - How To Prepare For Your HR Interview

How To Prepare For Your HR Interview Before you begin thinking about how you are going to dress for the interview it is important to do your research first You should learn everything you can about the company you wish to work for When you have detailed information about your employer you will conve
 

HR Interview - Telephone Interview Etiquette

Telephone Interview Etiquette When you conduct a telephone interview for a job it is important to show the proper etiquette Not only is it important it is critical is you wish to be hired by the company There are a number of things you will want to do and other things should never be done mosgoogle
 

HR Interview - How To Succeed At HR Interviews

How To Succeed At HR Interviews There are a number of things you will need to do in order to make sure you pass the interview process Your appearance is something that you will want to pay close attention to Even if you feel that your appearance shouldn t be a factor in whether or not you re highere
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape