Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AbstractStringBuilder in jdk1.5

 
Neha D
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic