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 how hashmap works?
Who found java?
What is a private class in java?
What are the methods used to implement for the key object in the hash map?
Can an interface have a constructor?
How is java created?
What is nan in java?
What are adapter classes?
Explain purpose of sleep() method in java?
What is a hashmap used for?
Can we override tostring method in java?
What is considered an anti pattern?
Name few java.lang classes introduced with java 8 ?
Explain the difference between an object-oriented programming language and object-based programming language?
Can sleep() method causes another thread to sleep?