• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clarification required in StringBuffer insert method...

 
S Thanigaivel
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one explain me the functionality of the following code with an example



Thanks in advance!
 
Henry Wong
author
Marshal
Pie
Posts: 21015
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, according to the Javadoc for StringBuffer, it doesn't have the constructor that you are using. So this should not compile.

However, assuming you have a typo... according to the same javadoc, the method is an insertion of a string at an offset. In this case, the beginning of the string buffer. In your example, you are inserting a bunch of "0" into the beginning of the string buffer.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic