06.09.2021 Views

Java with BlueJ, 2016a

Java with BlueJ, 2016a

Java with BlueJ, 2016a

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

44 CHAPTER 2. BASICS<br />

you see the actual operator priorities. For example, both unary minus and<br />

boolean not have the same priority (15) which is much higher than most<br />

others. Assignment has the lowest priority (2).<br />

There are several operators we do not discuss in this text. There are operators<br />

for every level from 1 to 16; we have not included any of the operators at<br />

levels 1, 6, 7, or 8. You could consult a reference such as <strong>Java</strong> in a Nutshell<br />

[5] at some future date.<br />

Complex Expressions<br />

Expressions can be very complex . . . each operand can itself be an expression<br />

that evaluates to true or false. Consider the following complex expression<br />

where a, b, c, d, x, z are numeric types:<br />

boolean answer = a+b > c+d && x c+d<br />

and<br />

x (c+d)) && (x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!