which is true about String class in java?
replace function in string will change the content in the same memory location.
concat() function will append new string to the existing string in the same location.
string function has its own implementation of equals() function to check for content equivalency.
length function in string class, always returns 1 less than actual size
Both replace, and concat functions will not change the content in the same memory, it generates new string object with latest changes. length function always returns exact size (i.e no of characters in that string). String class has equals() function implementation to check for content equivalency. it has over ridden Object's equal function.
Back To Top