Top "Stringbuffer" questions

StringBuffer in Java is used as a thread-safe, mutable sequence of characters, replaced by StringBuilder in Java 5.0+

Null pointer access: The variable can only be null at this location

for(int i=0;i<n;i++){ for(int j=0;j<26;j++){ if(str.charAt(i)== strChar.charAt(j) ) * …

java nullpointerexception stringbuffer
What is more efficient StringBuffer new() or delete(0, sb.length())?

It is often argued that avoiding creating objects (especially in loops) is considered good practice. Then, what is most efficient …

java instance stringbuffer performance
"StringBuffer is synchronized (or thread-safe) and StringBuilder is not", why does this make StringBuffer methods slower?

After reading this - What does 'synchronized' mean? I was still unable to understand why StringBuffer would be slower than …

java synchronization thread-safety stringbuilder stringbuffer
Most efficient way to concatenate Strings

I was under the impression that StringBuffer is the fastest way to concatenate strings, but I saw this Stack Overflow …

java stringbuffer
What does " StringBuilders are not thread-safe" mean?

I have read some articles about the pros and cons of String and StringBuilder in the Java Programming language. In …

java string multithreading stringbuilder stringbuffer
How to remove last character of string buffer in java?

I have following code, I wanted to remove last appended character from StringBuffer: StringBuffer Att = new StringBuffer(); BigDecimal qty = m_…

java string stringbuffer
Java: StringBuffer to byte[] without toString

The title says it all. Is there any way to convert from StringBuilder to byte[] without using a String in …

java string bytearray stringbuffer
How is StringBuffer used with .append

I'm doing a computer science project and I need to incorporate StringBuffers. I need help with what .append does and …

java string-concatenation stringbuffer
Does the StringBuffer equals method compare content?

Possible Duplicate: Comparing StringBuffer content with equals StringBuffer s1= new StringBuffer("Test"); StringBuffer s2 = new StringBuffer("Test"); if(s1.equals(…

java string equals stringbuffer
How to use replaceAll() method in StringBuffer?

I need to replace multiple words in a string buffer. So I am looking for a replaceAll method in StringBuffer. …

java stringbuffer