![]() |
What is the use of assert keyword?
What is the use of assert keyword?
|
assert is a java keyword used to define an assert statement. An assert statement is used to declare an expected boolean condition in a program.
|
Java assertion feature allows developer to put assert statements in Java source code to help unit testing and debugging. Assert keyword validates certain expressions. It replaces the if block effectively and JVM throws an error AssertionError if assertion fails. So, it is mainly used for testing purpose.
|
The assert keyword makes an assertion about the code. It enables developers to test assumptions in their programs as a way to defect and fix bugs.
|
The assert keyword validates certain expression it is mainly use for testing purpose.
|
All times are GMT -7. The time now is 05:23 PM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.