Object Oriented Software Engineering   View all facts   Glossary   Help
subject > programming language construct > statement > decision-making statement > Java decision-making statement > Java try catch statement
Next Java decision-making statementJava if statement    UpJava decision-making statement    Previous Java decision-making statementJava switch statement   

Java try catch statement
subjectfact 
Java try catch statementhas example
//Any division by zero that occurs when executing the 
//try block will result in execution of the catch block.
//Once either block completes, execution continues
//at the statement after the catch block.
try
{
result = numerator / denominator;
validResult = true;
}
catch (ArithmeticException e)
{
validResult = false;
}
link: chapter2section2.8.html#883, 2001-08-30 14:56:22.0
is a subtopic of The Basics of Java2001-08-30 14:56:22.0
is a kind of Java decision-making statement2001-08-30 14:56:22.0
Java statementis terminated by a semicolon2001-08-30 14:56:21.0
statementshould be not more than one line long if possible2001-08-30 14:57:47.0