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.
Nesta página do site você pode assistir ao vídeo on-line Learn Java Programming - Assertions Part Two Tutorial (assert keyword) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Daniel Ross 19 Janeiro 2016, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,636 vezes e gostou 21 espectadores. Boa visualização!