lAlmost all operators
work only with primitives (not class types)
And the operators are those that you know (except there
is no sizeof operator)
l=, == and != work on
all objects of any type (even class types!!!!)
But, if
you use them with a reference to an object you are just manipulating the references.
= causes
two object references to point to the same object (feels like shallow copy!)
== and != compares two references to see if
they are pointing to the same object
(or not)!
And,
since there is no operator overloading we cant change this to do a deep copy!
This is
because Java allows us to use references truly as aliases. You can cause a deep copy to happen simply (?) by coping each of
the members directly that are
part of a class or calling a member function to do this
lThe String class
also supports + and +=
l