The String
class represents an immutable string. There would be no purpose to cloning a String
. If you feel that you need to clone it, then you can just reuse the same reference and achieve the same effect.
Even if you could clone
s1
as s2
, then s1 != s2
would still be true
. They'd still be references to distinct objects.