how to handle exceptions in core applications?

Answers were Sorted based on User's Feedback



how to handle exceptions in core applications?..

Answer / tamilvanan

in core java, we can handle the exception by the following
key words
1.try
2.catch
3.finally
4.throws(it throws only predefined exception)
5.throw(it throw both predefined and userdefined exception)

Is This Answer Correct ?    9 Yes 0 No

how to handle exceptions in core applications?..

Answer / laxmi

In core applications we can handle the exceptions by using
try &catch blocks.

ex:
class excep
{
public static void main(String[] args)
{
try
{
System.out.println(2/0);
}
catch(Exception e)
{
System.out.println(e);
}

}
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

How to add menushortcut to menu item?

0 Answers  


What are static methods?

0 Answers  


why java does not have operator overloading?

2 Answers  


What is Remote Interface ?

6 Answers   CTS,


Is null or empty java?

0 Answers  


What happens when a main method is declared as private?

22 Answers   DELL, Infosys, L&T, Sun Microsystems,


Is arraylist ordered?

0 Answers  


Why runnable interface is used in java?

0 Answers  


Differentiate between postfix and prefix operators in java.

0 Answers   HCL,


What is Session and cookies?Explain in detail with an example?

4 Answers   Accenture, CTS,


Can you call a method on a null object?

0 Answers  


What is java virtual machine? Explain

0 Answers  


Categories