Suppose we read a sentence using scanf e.g. "My name is ABC" in a string.
Printing this string using a printf statement prints "My".
Go for another successi...
String is Immutable where as StringBuffer is Mutable.Mutable: The objects whose contents can be modified is called as Mutable.Ex: U can try this.String myStr...
Suppose we read a sentence using scanf e.g. "My name is ABC" in a string.
Printing this string using a printf statement prints "My".
Go for another successi...
System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed....
System.String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed....
a) String objects are constants and immutable whereas StringBuffer objects are not.
b) String class supports constant strings whereas StringBuffer class suppor...
In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization.
e.g String s;...
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed....
A string buffer implements a mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some partic...
System.String is immutable, System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed....