hi to all. well can you please tell me that why String class
is immutable?

Thanks in advance.

Answer Posted / syed

Since, return type of the string class cannot be altered
with substrings or any ammendments to it .

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class have multiple constructors?

542


What is the purpose of the strictfp keyword?

616


Is hashset ordered java?

597


Does list maintain insertion order java?

545


What is java dot?

500






Explain working of call by reference function invoking.

597


Can we overload the methods by making them static?

510


What is garbage collection? What is the process that is responsible for doing that in java?

665


What does string [] args mean?

547


Is null function in java?

572


What is the difference between the final method and abstract method?

546


Differentiate between run time error and syntax error.

575


Define how can we find the actual size of an object on the heap?

665


What does compareto () do in java?

580


What is the basic difference between string and stringbuffer object?

581