difference between string and string buffer in java | java interview questions | wikitechy.com

preview_player
Показать описание
String is an immutable object.String Buffer is a mutable object.

difference between string and stringbuffer in java in tabular form, difference between string and stringbuffer and stringbuilder, difference between string and stringbuffer in java pdf,difference between string and stringbuffer class,difference between string and stringbuffer in java ppt,using stringbuffer,difference between string and stringbuffer in java with example,difference between string stringbuffer and stringbuilder in java with example,difference between string and stringbuffer class in java with example,difference between string and stringbuilder

Follow us on:
Рекомендации по теме
Комментарии
Автор

The explanation was precise and useful

priyankamurali
Автор

Simply stated, objects of type String are read only and immutable. The StringBuffer class is used to represent characters that can be modified. The significant performance difference between these two classes is that StringBuffer is faster than String when performing simple concatenations.

monishamoni.
Автор

Code sampleString StringBufferImmutable MutableString s=new String("karthik"); StringBuffer sb=new System.out.println(sb);...

geethachinnapaiyan
Автор

Well, the most important difference between String and StringBuffer/StringBuilder in java is that String object is immutable objects are mutable. By immutable, we mean that the value stored in theString object cannot be changed.Feb 15, 2008

agilan
Автор

A thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. ... Java provides the StringBuffer and String classes, and the String class is used to manipulate character strings that cannot be changed. Simply stated, objects of type String are read only and immutable.Mar 13, 2010

saranrajs
Автор

String class overrides the equals() method of Object class. So you can compare the contents of two strings by equals() method.

StringBuffer class doesn't override the equals() method of Object class.

nithinyashwanth
Автор

Java String class provides a lot of methods to perform operations on string such as compare(), concat(), equals(), split(), length(), replace(), compareTo(), intern(), substring() etc.

The java.lang.String class implements Serializable, Comparable and CharSequence interfaces.

hemamalinig
Автор

Every immutable object in Java is thread safe, that implies String is also thread safe . String can ... The object created through StringBuffer is stored in the heap .

saranrajs
Автор

Well, the most important difference between String and StringBuffer/StringBuilder in java is that String object is immutable objects are mutable. By immutable, we mean that the value stored in the String object cannot be changed

vidhyatharan
Автор

most important difference between String and StringBuffer/StringBuilder in java is that String object is immutable whereas StringBuffer/StringBuilder objects are mutable. By immutable, we mean that the value stored in the String object cannot be changed.
Reply

aswinchandarj
Автор

String is immutable whereas StringBuffer and StringBuider are mutable classes. StringBuffer is thread safe and synchronized whereas StringBuilder is not, thats why StringBuilder is more faster than StringBuffer. String concat + operator internally uses StringBuffer or StringBuilder class.

vigneshjollyman
Автор

Well, the most important difference between String and StringBuffer/StringBuilder in java is that String object is immutable whereas StringBuffer/StringBuilder objects are mutable. By immutable, we mean that the value stored in the String object cannot be changed.

music-patiencealwayspaysof
Автор

As you will find that there are minor differences between the above mentioned classes. String is immutable ( once created can not be changed )object . The object created as a String is stored in the Constant String Pool . Every immutable object in Java is thread safe, that implies String is also thread safe .

samuelsam
Автор

So incase, we are going to do more modificatios on String, then ... What is difference between wait and sleep methods in java? What is servlet context ?

samuelsam
Автор

StringBuffer and StringBuilder have the same methods with one differenceand that's of synchronized( which means it is thread safe and hence you can use it when you implement threads for your methods) whereasStringBuilder is not synchronized( which implies it isn't thread safe).

deenasteyn
Автор

Well, the most important difference between String and StringBuffer/StringBuilder in java is that String object is immutable whereas StringBuffer/StringBuilder objects are mutable. By immutable, we mean that the value stored in the String object cannot be changed

lavanyaumapathy
Автор

e most important difference between String and StringBuffer/StringBuilder in java is that String object is immutable whereas StringBuffer/StringBuilder objects are mutable. By immutable, we mean that the value stored in the String object cannot be changed.

monishamoni.
Автор

StringBuffer and StringBuilder have the same methods with one difference and that's of synchronization. StringBuffer is synchronized( which means it is thread safe and hence you can use it when you implement threads for your methods) whereas StringBuilder is not synchronized( which implies it isn't thread safe).

lavanyaumapathy
Автор

Difference between String and StringBuffer in java, let's see the String vs StringBuffer in java with examples, there is given a list of main differences between ...

saranrajs
Автор

Java provides the StringBuffer and String classes, and the String class is used to manipulate character strings that cannot be changed. Simply stated, objects of type String are read only and immutable

kalieswaran