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.
In questa pagina del sito puoi guardare il video online Learn Java Programming - Assertions Part Two Tutorial (assert keyword) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Daniel Ross 19 gennaio 2016, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,636 volte e gli è piaciuto 21 spettatori. Buona visione!