Java =<<< operator

103 Views Asked by At

In Java, if I do x = x <<< 2, everything works fine, but if I do x =<<< 2, it does not.

Is there just no =<<< operator in Java?

If so, then why is there an =<< operator?

Thank you.

2

There are 2 best solutions below

1
On BEST ANSWER

You said that

if I do x = x <<< 2, everything works fine

Are you sure? <<< is not an operator in Java.

There is >>, <<, and >>>. There are also the corresponding >>=, <<=, and >>>= operators.

0
On
`b >>>= 4` works fine.

<<< is not valid operator, you can shift only to the right without sign.