Professional Documents
Culture Documents
BCAC-301 - Lecture 5
BCAC-301 - Lecture 5
Conditional Operator
Bitwise Operator
Instanceof Operator
New Operator
Conditional Operator
3
Example:
int a=10,b=20;
max = (a>b) ? a : b;
Conditional Operator (CONTD.)
4
Operator Meaning
<< Shifts the bits to left
>> Shifts the bits to right
>>> Right shift with zero fill or
unsigned right shift
& Bitwise AND
| Bitwise O R
~ Bitwise inversion (1’s
complement)
^ Bitwise Exclusive O R
Left shift (<<)
6
0 0 1 1 0 1 0 0 0
0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 1 1