Specifications
Sun Services
Java™ Programming Language
Module 4, slide 10 of 31
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Logical Operators
• The boolean operators are:
! – NOT & – AND
| – OR ^ – XOR
• The short-circuit boolean operators are:
&& – AND || – OR
• You can use these operators as follows:
MyDate d = reservation.getDepartureDate();
if ( (d != null) && (d.day > 31) {
// do something with d
}










