As i know when we make change in string new copy will created and then change
but i want to know does it also work when we make string in heap using new.
Is that also immutable
String in heap doubt
@sahil29roy_36473f38aaa9dc68 When you use a new keyword and address is assigned to that object. SO whenever you create a string using new then new address will be assigned everytime.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.