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 thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

0 Answers  


Why java is a platform independent? Explain

0 Answers  


Why local variables are stored in stack?

0 Answers  


Can Anybody tell the diff b/w jdk1.6 and latest version.

2 Answers  


What is the main difference between java platform and other platforms?

0 Answers  






What do you mean by stack?

0 Answers   Accenture,


Why should we use singleton pattern instead of static class?

0 Answers  


What is an example of character?

0 Answers  


all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.

4 Answers  


Is it possible to declare abstract class as final?What happens if we do so?

1 Answers  


What is the implementation of destroy method in java. Is it native or java code?

0 Answers  


Can a list be null in java?

0 Answers  


Categories