Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Java doesn't support <<< operator

Tags:

Why doesn't Java support the <<< (unsigned left shift) operator, but does support the >>> (unsigned right shift) operator?

like image 448
Cs ツ Avatar asked Mar 10 '13 03:03

Cs ツ


People also ask

Which operator Java does not support?

Unlike C++, Java doesn't support operator overloading. Java doesn't provide freedom to programmers, to overload the standard arithmetic operators e.g. +, -, * and / etc.

What operators can be overloaded in Java?

No, Java doesn't support user-defined operator overloading. The only aspect of Java which comes close to "custom" operator overloading is the handling of + for strings, which either results in compile-time concatenation of constants or execution-time concatenation using StringBuilder/StringBuffer.

Is method overloading supported in Java?

Method Overloading in Java is a concept related to Object Oriented Programming (OOP). Java supports overloading of methods and can distinguish between different methods with method signatures.

Which operator is called as overloaded operator in Java?

Java does not support operator overloading, except for string concatenation for which it overloads the + operator internally.


1 Answers

Java adds the operator ">>>" to perform logical right shifts, but because the logical and arithmetic left-shift operations are identical, there is no "<<<" operator in Java.

from Shifts in Java...

like image 83
loxxy Avatar answered Sep 19 '22 18:09

loxxy