how to handle exceptions in core applications?
Answers were Sorted based on User's Feedback
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 |
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 |
Why main() method is public, static and void in java ?
What is a singleton class in Java? And How to implement a singleton class?
Difference between Web-based applications,Client- Server applications and Distributed applications?
What does substring mean?
Is multiple inheritance allowed in Java? Why ?
Is java is a fully object object oriented language?
How do you replace a string in java?
What is the purpose of stub and skeleton?
Is java same as core java?
Explain yield() method in thread class ?
Why all programming languages have main as a execution starting point?
How are this() and super() used with constructors in java programming?