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

what is multi-tasking

3 Answers   Tech Mahindra, Anand Group, Photon Infotech,


Is there a way to increase the size of an array after its declaration?

0 Answers  


Can we restart a dead thread in java?

0 Answers  


Given: 11. public static void main(String[] args) { 12. Integer i = uew Integer(1) + new Integer(2); 13. switch(i) { 14. case 3: System.out.println(”three”); break; 15. default: System.out.println(”other”); break; 16. } 17. } ‘What is the result? 1 three 2 other 3 An exception is thrown at runtime. 4 Compilation fails because of an error on line 12.

9 Answers  


How does thread synchronization occurs inside a monitor?

0 Answers  






What are the main uses of the super keyword?

0 Answers  


What is difference between final and finally in java?

0 Answers   Cyient,


If a variable is declared as private, where may the variable be accessed?

0 Answers  


Define how objects are stored in java?

0 Answers  


why doesn't java run on all platforms?

0 Answers  


What is a Presistent Object?

0 Answers   InfoAxon Technologies,


Can we define package statement after import statement in java?

0 Answers  






Categories