It's not a secret anymore!*
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AbstractStringBuilder in jdk1.5
 
Similar Threads
Can we replace StringBuilder where we used StringBuffer in JDK1.5
AbstractStringBuilder is not visible
StringBuffer doubt
string vs stringbuffer
setColor() method in the Graphics class