Java Logical Operators

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Logical operators

&&, ||, &, | and !

&

And. Returns a true value if both expressions are true. This operator always evaluates both expressions.

&&

And. Returns a true value if both expressions are true. This operator only evaluates the second expression if necessary.

expression

Is a construct made up of variables, operators, and method invocations, which are constructed according to the syntax of the language, that evaluates to a single value.

1.5 - 1.7

Java Development Kit (JDK)

!

Not. Reverses the value of the expression.

|

Or. Returns a true value if either expression is true. This operator always evaluates both expressions.

||

Or. Returns a true value if either expression is true. This operator only evaluates the second expression if necessary.

1.2 - 1.4

Software Development Kit (SDK)

short-circuit operator

The && and || only evaluate the second expression if necessary.

Web apps

applet

order of precendence for logical, arithmetic and relational operations

arithmetic, then relational and then logical


Kaugnay na mga set ng pag-aaral

Chapter 3 - Basic Shooting Skills

View Set

F2F GOVT2305 Federal Government exam 2 review

View Set

APUSH The american Pageant ch. 2

View Set

Composite Risk Management Army/Civilian

View Set

Chapter 36: The Great Depression and the New Deal

View Set

A first look at Communication Ch. 1-3

View Set

Mississippi Real Estate License Law and National License Math

View Set