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
Explain the JDB in depth & command line.
What is java jit compilers?
Explain different ways of creating a thread. Which one would you prefer and why?
Which collection is thread safe in java?
Which list does not allow duplicates in java?
why java does not support unsigned keyword?
When should I use singleton?
What does I ++ mean?
Explain about anonymous inner classes ?
Can we use a switch statement with strings?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
Write java program to reverse string without using api?
What are the advantages of inner classes?
What class allows you to read objects directly from a stream in java programming?
What is the default size of set in java?