In the case of String several references pointing to the Same object. By using one reference , if we are performing any change in the existing object the remaining references will be impacted. To resolve this problem SUN people declared as String objects are immutable. According to this if we trying to perform any changes with those changes a new object is created.
No comments:
Post a Comment