[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 ...
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 477 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jan 17, 2018 19:17:58.