my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes StringBuffer & StringBuilder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "StringBuffer & StringBuilder" Watch "StringBuffer & StringBuilder" New topic

StringBuffer & StringBuilder

Sanjay Izardar

Joined: Apr 18, 2011
Posts: 19
are there some methods which are defined in StringBuffer but not in StringBuilder class?
Darryl Burke

Joined: May 03, 2008
Posts: 4523

What does the API say?

luck, db
There are no new questions, but there may be new answers.
Ikpefua Jacob-Obinyan
Ranch Hand

Joined: Aug 31, 2010
Posts: 394

Sanjay Izardar wrote:

are there some methods which are defined in StringBuffer but not in StringBuilder class?

Ikpefua wrote:

Hello Sanjay, the API says both classes are virtually the same, the ONLY difference is that
StringBuffer has sychronized methods to make it threads safe.

For the exams you need to know the differences between the StringBuffer/StringBuilder compared to the String class.

I hope this helps.

In Your Pursuit Towards Certification, NEVER Give Up.
Mala Gupta
Ranch Hand

Joined: Sep 27, 2002
Posts: 248
Apart from referring to the Java API, you can also refer to the source code of these classes - if you are keen on witnessing the differences yourself.


Author of Manning's OCA Java SE 7 Programmer I Certification Guide and OCP Java SE 7 Programmer II Certification Guide
I agree. Here's the link:
subject: StringBuffer & StringBuilder
Similar Threads
Printing Int Array to File using PrintWriter
Problem in String Buffer - incrementing char in string
String and StringBuffer
how to make this code perform better
Ya got String, got StringBuffer - and now ya got StringBuilder!