aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "AbstractStringBuilder in jdk1.5" Watch "AbstractStringBuilder in jdk1.5" New topic
Author

AbstractStringBuilder in jdk1.5

Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32
Hi,

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?

Thanx.

Regards,
- 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: AbstractStringBuilder in jdk1.5
 
Similar Threads
setColor() method in the Graphics class
Can we replace StringBuilder where we used StringBuffer in JDK1.5
StringBuffer doubt
AbstractStringBuilder is not visible
string vs stringbuffer