Senin, 03 April 2017

How to use assertions in java programming

Assertions in Java   Definition: An assertion is a condition that should be true during the program execution. They are generally used to detect errors (testing) during development of software. They have no use after the code is released to the users. They encourage defensive programming.   Creating and Using Assertions: Assertions can be created using the assert keyword. The general form of using assert keyword is as follows: assert condition; When the given condition becomes false, AssertionError is thrown by the Java run-time. The second form of assert is as follows: assert condition : expr; In the above syntax, expr can be any non-void value which will be passed on

The post How to use assertions in java programming appeared first on Coding Security.


How to use assertions in java programming
read more

Tidak ada komentar:

Posting Komentar