The earlier versions of java had multiple catch block one after the other where we can handle several exceptions in one try and multiple catch block as follows:
Java 7 has introduced the new feature of adding multiple exception objects in one catch block as below.
try
{
//do someting;
}
catch(Exception1, Exception2 e)
{
handleException(e)
}
This feature thereby reduces the overhead on the developer .
try
{
//do someting;
}
catch(Exception1 e)
{
handleException(e)
}
catch(SQLException e)
{
handleException(e)
}
Java 7 has introduced the new feature of adding multiple exception objects in one catch block as below.
try
{
//do someting;
}
catch(Exception1, Exception2 e)
{
handleException(e)
}
This feature thereby reduces the overhead on the developer .
No comments:
Post a Comment