• Post Reply Bookmark Topic Watch Topic
  • New Topic

Assert statement  RSS feed

 
Pritam Chatterjee
Ranch Hand
Posts: 38
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An assert statement checks a Boolean expression during run time execution.
Is this true?
 
Scott Winterbourne
Ranch Hand
Posts: 116
2
Eclipse IDE Java PHP
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is true. They are not enabled by default. They need to be activated via the command line when you execute the code.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assertions are intended for use in testing, and are unnecessary in production code. By taking the flag off which enables assertions, one can use the code as production code without the overhead of evaluating the assertions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!