Answer Posted / raja moram
The concept of suspending the execution of a function based
on the user defined condition is known as ASSERTION.
We implement the concept of Assertions using 'assert' keyword.
We use 'assert' keyword by mentioning a condition, if the
mentioned condition is not satisfied the 'assert' keyword
suspends the execution of the method in the middle and
transfers the control along with the 'AssertionError' class
object to the calling place.
Here 'AssertionError' is the subclass of 'Error'class.
To enable Assertions application:
java -ea <className>
This concept of ASSERTIONS is introduced from JDK 1.5 onwards
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
what do you mean by classloader in java?
Can a main method be overloaded?
What does next mean in java?
What does int [] mean in java?
what do you mean by java annotations?
What is a null class?
Why char array is preferred over string for storing password?
What is difference between ++ I and I ++ in java?
Is list ordered in java?
What is ordered map in java?
What is int lol?
What is an example of a conditional statement?
Name some classes present in java.util.regex package.
What is constructor in java ?
Explain about instanceof operator in java?