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...


How many catch blocks can be there for a single try block?

Answers were Sorted based on User's Feedback



How many catch blocks can be there for a single try block?..

Answer / gladiator

There can be any number of catch block for a single try
block.

However only the catch block encountered first on the call
stack that satisfies the condition for the exception will
be executed for that particular exception, rest will be
ingnored.

Is This Answer Correct ?    69 Yes 4 No

How many catch blocks can be there for a single try block?..

Answer / bikas pandey

You can have as many as catch block for a single try block

Is This Answer Correct ?    30 Yes 1 No

How many catch blocks can be there for a single try block?..

Answer / d.s naidu

Single try block can handle multiple catch blocks.Let
assume if you have 4 catch blocks for a single try block.
while excuting/debugging the code, if the exception raises
that will go the appropriate catch block and resolve the
problem by the programmer. the remaining 3 catch blocks
will raise , if those really having the exception as per
the code logic

Is This Answer Correct ?    20 Yes 4 No

How many catch blocks can be there for a single try block?..

Answer / ankita

The try block is immediately followed by zero or more catch
blocks. It means you can use as many catch blocks with one
try block. But there must be at least one catch block
following a try block, unless you are using a finally block.
For example, consider the following program:
Class Exception {
Public Static void main(string args[ ] ){
int d,a;
try { // monitor a block of code
d=0;
a=42/d;
System.out.println(*This will not be printed,*);
} catch(Arithmetic Exception) { // Catch divide-by-zero
error System.out.println(*Division by Zero*);
}
System.out.println(*After catch statement.*);
} }
This program generates the following output
Division by Zero.
After Catch Statement.

Is This Answer Correct ?    8 Yes 0 No

How many catch blocks can be there for a single try block?..

Answer / ravindarjobs

Hey! The great Gladiator, where are u? Come on to the War.

u have to catch so many people and kill them at a time

Dont waste time on giving suggestions on try and catch
blocks.

Thanks and Regards
Ravindarjobs

Is This Answer Correct ?    6 Yes 42 No

Post New Answer

More C Sharp Interview Questions

How can we set class to be inherited, but prevent the method from being over-ridden?

0 Answers  


What is difference between === and ==?

0 Answers  


What Are The .Net Object

2 Answers   IMB, Reliance,


How do you implement thread synchronization (object.wait, notify,and criticalsection) in c#?

0 Answers  


What is using keyword?

0 Answers  


I created a class which is inherited from interface IDisposable. Now if I use object of this class with using keyword. Then How the dispose method will get call. Does garbage collector call it or some else.

2 Answers   Sapient,


What is a console in c#?

0 Answers  


What is the main purpose of delegates in c#?

0 Answers  


Is struct object oriented?

0 Answers  


is it possible to access a remote web service Without UDDI?

0 Answers   TCS,


What is asp net c# corner?

0 Answers  


Why do we need constructor in c#?

0 Answers  


Categories