1.

Why String Are Called Immutable Data Type ?

Answer»

The memory representation of string is an Array of Characters, So on re-assigning the NEW array of Char is formed & the START ADDRESS is changed . Thus keeping the Old string in Memory for Garbage COLLECTOR to be disposed.

The memory representation of string is an Array of Characters, So on re-assigning the new array of Char is formed & the start address is changed . Thus keeping the Old string in Memory for Garbage Collector to be disposed.



Discussion

No Comment Found