66 973
Assignments Done
99,2%
Successfully Done
In November 2018

Answer to Question #3094 in Java | JSP | JSF for Gina

Question #3094
What do the try and the catch commands in Java do?
Expert's answer
try catch commands makes possible to process exceptions. Syntax:
try
{
//your code that may cause exception
}
catch(Exception e) //here can be another call of exception
{
//code that process exceptions
}
final //you can loose this block. Just do not write it. It is not error
{
//code that will be executed any case
}
See documentation to get to know about list exception classes.
example:
try
{
a=b/c;
}
catch(Exception e)
{
System.out.println("Division by zero occured");
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions