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.
En esta página del sitio puede ver el video en línea Learn Java Programming - Assertions Part Two Tutorial (assert keyword) de Duración hora minuto segunda en buena calidad , que subió el usuario Daniel Ross 19 enero 2016, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,636 veces y le gustó 21 a los espectadores. Disfruta viendo!