.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

What's the C# equivalent of C++ catch (.), which was a catch-all statement for any possible exception?

Posted By :Ghanashyam Nayak     Posted Date :September 09, 2010    Points :10   Category :C# 
A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

You can also find related Interview Question to What's the C# equivalent of C++ catch (.), which was a catch-all statement for any possible exception?  below: 

Why is catch(Exception) almost always a bad idea?

  
Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project. (More...)

Can multiple catch blocks be executed for a single try statement?

  
No. Once the proper catch block processed, control is transferred to the finally block (if any).

So we can not execute multiple catch block in one try block (More...)

Can multiple catch blocks be executed for a single try statement?

  
No. Once the proper catch block processed, control is transferred to the finally block (if there are any). (More...)

Can we put multiple catch blocks in a single try statement in C#?

  
Yes. Multiple catch blocks may be put in a try block. (More...)

Can code inside multiple catch block be executed?

  
No, Code can not execute in mutiple catch block (More...)

What is the equivalent statement for exit in C#?

  
Application.Exit() or System.Environment.Exit (More...)

What is the syntax of try catch?

  
BEGIN TRY
END TRY
BEGIN CATCH

END CATCH; (More...)

Can multiple catch blocks be executed?

  
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. (More...)

What is the structure of try catch block?

  
Begin Try

End Try
Begin Catch

End Catch (More...)

Convert the expression ((A + B) * C - (D - E) ^ (F + G)) to equivalent Prefix and Postfix notations.

  
Prefix Notation:
^ - * +ABC - DE + FG

Postfix Notation:
AB + C * DE - - FG + ^ (More...)

How many Columns per INSERT statement is allowed

  
4096 Columns allowed in per Insert SQL (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend