Java Reference

In-Depth Information

Less than or equal to-
This relation operator shows that one value is smaller or equal but

not greater when compared to other and it is represented by “<=”.

Boolean logical operators

Logical AND-
It is represented by “&”.

For example

A & B = If a is false and b is true it results as false, but is both are true it results as

true. Similarly when both are false it results as false.

Logical OR-
It is signed |.

For example

A | B = If a is false and b is true it results as true, but is both are true it results as

true. Similarly when both are false it results as false.

Logical XOR-
It is shown using “^”.

For example

A ^ B = If a is false and b is true it results as true, but is both are true it results as

false. Similarly when both are false it results as false.

Logical Unary Not-
It is depicted as “!”.

For example

! A = If a is false it results as true, but if a is true it results as false.

Assignment operators

The assignment is the single equal sign that is represented by “=”.

The general representation

var = expression;

In this the variable, which is represented asvar should be compatible with the type of ex-

pression.

Int a, b, c;

a = b = c = 100;

The ? Operator