[Logo]
Forums Register Login
Cloning
Q. Can I clone String Object if yes then How ?
(1 like)
Since String is immutable, you never need to.

However, if you really want to...you can't use clone(), because it isn't Cloneable. But you can use the copy-constructor to get a copy of it (new String(str)).
Thanks Matthew Brown ...

This thread has been viewed 537 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 17, 2018 11:45:59.