-1

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.

MarkusWillson
  • 411
  • 1
  • 3
  • 11

2 Answers2

7

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.

RealSkeptic
  • 33,993
  • 7
  • 53
  • 79
416E64726577
  • 2,214
  • 2
  • 23
  • 47
1
`b >>>= 4` works fine.

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

hiimjames
  • 431
  • 4
  • 10