what is Assertion?
Answers were Sorted based on User's Feedback
Answer / myluvdeepu
assertion is a condition which on being true will execute the statement.
else(if condition is false) it will throw an assertion error.)
if we want to enable the assertion, we need to enable the assertion by the option -ea.
| Is This Answer Correct ? | 10 Yes | 4 No |
Answer / 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 |
Answer / sulakshna
Assertion is a predicate expressing a condition that a
database always satisfy.
| Is This Answer Correct ? | 2 Yes | 3 No |
Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public private.
when should you use stringbuilder class in a program?
Why do we need main method to execute a java program?
can we access the method of class without creating the object of the class
What is the importance of hashcode() and equals() methods?
How use .contains in java?
Difference between Interface & Abstract class?
What are the types of collections in java?
Is there any sort function in java?
How can we make a class singleton?
What is class and its types?
Hi ,i convert contrller as jSp And presentation as servlet ...will it do? if so what are advantage and idsadvantages