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 |
Can we access private data outside of the class directly in java programming language? Why There is no runtime checking in java, which leads to access the private data directly outside of a class?
why we import both packages java.awt.*; and java.awt.event.*; as java.awt.*; can import all classes na. then what is the need of importing java.awt.event.*; ?
What is difference between pointer and reference?
What is dynamic binding(late binding)?
why would you use a synchronized block vs. Synchronized method? : Java thread
What are the files generated after using IDL to java compiler?
To the class members how can we provide security?
How do you read and print a string in java?
int a=10,b=20,c=30 a= b+c;b=a+c;c=a+b; System.out.println("The value is"+a+b+c;
How do you achieve singleton?
What are the core java topics?
What are register variables what are the advantages?