Java 2 SDK for Solaris Developer's Guide


A new keyword is added to the language. Use of the assert keyword is governed by one modified production and one new production in the grammar:

           <All current possibilities, as per JLS,
              Section 14.4> AssertStatement          
   assert Expression1;
   assert Expression1 : Expression2; 

In both forms of the assert statement, Expression1 must be of type boolean or a compile-time error occurs.