Where we use assertion in java programming?
Answers were Sorted based on User's Feedback
Answer / saipratapreddy maddireddy
->assertions are using for debugging/ testing the flow of
program at the time of development and testing phases not
yet deployment phase.
we can use the assertions any where in java program is
valid but we have to use it in appropriate way.
->the syntax of Assertion is:
assertion(boolean): value;
*we can take any value after colon(:) that may be int,
char,string and method call
when ever assertion parameter is "true" then it will
proceed the remaining execution of program otherwise it
throw an exception saying"java.lang.AssertionError:xxxx"
assertion for testing purpose if assumption value is
false then it raises an exception but to handling this
exception by using "try-catch-finally" is not recommended.
| Is This Answer Correct ? | 3 Yes | 0 No |
What is scripting elements in jsp?
Can we override serivice()method in jsp?
Which categories can be divided jstl tags, give examples.
How do you delete a cookie within a jsp?
How to works asjx in jsp?
Can you stop multiple submits to a web page that are initiated by clicking to refresh button?
Give the use of exception object.
How do I perform browser redirection from a jsp page?
How can we disable java code or scripting in jsp page?
What is page scope?
Can a subsequent request be accessed with one’s servlet code, if a request attribute is already sent in his jsp?
Which package does jsp api consist of?