Learn Java Programming - Assertions Part Two Tutorial (assert keyword)

Veröffentlicht am: 19 Januar 2016
auf dem Kanal: Daniel Ross
1,636
21

After watching my Assertions Part 1 Tutorial you should have a general idea of what an assertion is used for. In part 1 I demonstrated one of two styles of the assert statement.
assert (expression) : argument to pass into the AssertionError constructor ;
The second style is even more simple:
assert (expression) ;
The second style will simply throw an AssertionError if the expression evaluates to false. You will receive the same sort of program stopping crash that you experience with the first style, only it will simply contain the method and line number of the assert statement. There is not much of a difference between the two versions, just a little more debugging info in the first style.


Auf dieser Seite können Sie das Online-Video Learn Java Programming - Assertions Part Two Tutorial (assert keyword) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daniel Ross 19 Januar 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,636 Mal angesehen und es wurde von 21 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!