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
How many digits is int32?
What does yield method of the thread class do?
Explain a situation where finally block will not be executed?
How do you check if two strings are equal in java?
What is the structure of java?
What is the purpose of using javap?
What is pangram in java?
Define inheritance?
What is the difference between normal report & matrix report?
What is the purpose of a transient variable?
Can we inherit a class with private constructor?
What is finalize() function in java?
What is an immutable class? How to create an immutable class?
What is the purpose of java?
Is null a keyword in java?