PUB ID

Tuesday, 22 December 2015

why no reverse() method in String class?

Because String Class Object  is Immutable. (an immutable object is an object whose state cannot be modified after it is created).
So modification is not allowed in string class in same object. If we want to reverse the String We should use StringBuffer class reverse() method.

No comments:

Post a Comment