Two Laptop Bag
The moose likes Swing / AWT / SWT and the fly likes AbstractStringBuilder in jdk1.5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "AbstractStringBuilder in jdk1.5" Watch "AbstractStringBuilder in jdk1.5" New topic

AbstractStringBuilder in jdk1.5

Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32

The StringBuffer class in jdk 1.5 is now extending to the AbstractStringBuilder class. So can any1 plz help me out in using the AbstractStringBuilder class. How to implement this class & what all changes needs to be done in the code where StringBuffer class is used?


- Neha
[ November 27, 2004: Message edited by: Neha D ]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Both StringBuffer and StringBuilder extend from Object, as shown at the top of their api. The difference is summarized in the first paragraph of the StringBuilder api: they are pretty much the same except for synchronization. The StringBuilder api recommends we use StringBuilder when the buffer is being used by only one thread and suggests that this will generally give better performance. So I would say use StringBuilder in the same way you use StringBuffer, and only when thread safety is not an issue.
wood burning stoves
subject: AbstractStringBuilder in jdk1.5
It's not a secret anymore!