Abstract Java Keyword: Examples
Abstract Java Keyword: Examples
All integer literals in Java are 32−bit int values unless the value is followed by l or L as in
235L,
indicating the value should be interpreted as a long.
Without a break statement, the flow of execution will flow into all following case and/or
default
blocks.
Every try block must have at least one catch or finally clause.
If a particular exception class is not handled by any catch clause, the exception
propagates up the call
stack to the next enclosing try block, recursively. If an exception is not caught by any
enclosing try
block, the Java interpretor will exit with an error message and stack trace.
do Java Keyword
The do keyword specifies a loop whose condition is checked at the end of each iteration.
Examples
do
{
<statements>
}
while (!found);
Remarks
The body of a do loop is always executed at least once. •
The semicolon after the condition expression is always required. •
Java floating point numbers can represent infinity and NaN (not a number). The Double
wrapper class
defines the constants MIN_VALUE, MAX_VALUE, NEGATIVE_INFINITY,
POSITIVE_INFINITY and NaN.
else Java Keyword
The else keyword is always used in association with the if keyword in an if−else
statement. The else clause is
optional and is executed if the if condition is false.
Examples
if (condition)
{
<statements>
}
else
{
<statements>
}
Remarks
None.