When try and catch block is used ?

Answers were Sorted based on User's Feedback



When try and catch block is used ?..

Answer / raghuveer

When chance of exception and not to terminate the
application

Is This Answer Correct ?    4 Yes 0 No

When try and catch block is used ?..

Answer / sujanya

we are useing the try/catch for handling the
exceptions ,and then we can able to read and understand
the exception easily.

Is This Answer Correct ?    2 Yes 0 No

When try and catch block is used ?..

Answer / ravikiran

try is used to enclose the code which is supposed to throw
an exception
catch is used to catch the exception which is raised with
in the try block

Is This Answer Correct ?    3 Yes 1 No

When try and catch block is used ?..

Answer / vivek

in order to over come an abnormal condition try and catch
block is used

Is This Answer Correct ?    0 Yes 0 No

When try and catch block is used ?..

Answer / anandh

Try and Catch block is used for Exception handling..
Try block is used for monitor the errors and using catch
block we can shows to users what type of Exception occurred
in our program ...see the following Example code it can be
useful..


class ExceptionExample
{
public static void main(String args[])
{
int d, a;
try
{
d = 0;
a = 42 / d;
System.out.println("This will not be printed.");
}
catch (ArithmeticException e)
{
System.out.println("Division by zero.");// Here shows
Exception to user
}

}
}

Is This Answer Correct ?    1 Yes 1 No

When try and catch block is used ?..

Answer / saroj

To detect the error.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Core Java Interview Questions

What is the symbol for space?

0 Answers  


How do you create a first line indent?

0 Answers  


What is method overloading in JAVA? Why is it not present in C ?

0 Answers   Akamai Technologies,


Why do we use return statement?

0 Answers  


What is size_t?

0 Answers  






What is the difference between iterator and enumeration ?

0 Answers  


What is java reflection api?

0 Answers  


how would you implement a thread pool? : Java thread

0 Answers  


Is java a virus?

0 Answers  


When object is created and destroyed?

0 Answers  


If you are reviewing the code of your team members, what points will you look at, assuming the performance of the application is not so great

2 Answers   KPIT,


What restrictions are placed on method overloading and method overriding?

5 Answers  


Categories