Why doesn't Java support the <<<
(unsigned left shift) operator, but does support the >>>
(unsigned right shift) operator?
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.
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.
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.
Java does not support operator overloading, except for string concatenation for which it overloads the + operator internally.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With