how to handle exceptions in core applications?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is bufferedwriter?

728


What is the difference between I ++ and ++ I in java?

705


What is the maximum length of a url?

708


what is singleton in java?

783


Explain the selection sort algorithm and state its time complexity?

803


Which is faster set or list in java?

770


How do you check if a string is lexicographically in java?

704


What does serializing data mean?

711


What is difference between local variable and global variable?

685


What is Java Package and which package is imported by default?

817


why java does not support unsigned keyword?

4678


What is size () in java?

795


When should a function throw an exception?

800


How thread scheduler schedule the task?

797


What does it mean that a class or member is final?

734