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 is number data type in java?
What is meant by nested loop?
Define nashorn in java8.
what are abstract functions?
why Interface used?
What is difference between final and finally in java?
What is the main advantage of passing argument by reference?
What is encapsulation in java?
In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?
What is the difference between the paint() and repaint() methods in java programming?
Can anonymous class have constructor?
Can you declare an interface method static?
Can you have two constructors in java?
How do you check if a string contains only numeric digits?
How do you add an element to a hashset in java?