File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes StringBuffer confusion ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "StringBuffer confusion ?" Watch "StringBuffer confusion ?" New topic

StringBuffer confusion ?

sharon daze

Joined: Feb 08, 2009
Posts: 16
Hello all ,

how i can increase a value of StringBuffer.
For example if i have "A" inside StringBuffer element then how i can increment it to next letter.

Thanks & Regards
Devaka Cooray
ExamLab Creator

Joined: Jul 29, 2008
Posts: 3910

sharon daze wrote:how i can increase a value of StringBuffer

What do you mean by increasing the value of StringBuffer? Did you mean converting from A to B, C to D, and so on? In that case, how if you increase the 'char' value of each letter in the string.



Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11952

If your stringBuffer contained "Hello. My name is Inigo Montoya.", what would you increment this to?

Further, I don't think this is a well defined problem, especially since different character sets may not have letters in the same order, or consecutive letters stored as consecutive integers. And what would you increment a 'z' to?

Can you define the problem better? Tell us exactly what you want - or if this is a homework assignment, give us the EXACT and COMPLETE text of it, and we can perhaps steer you better.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: StringBuffer confusion ?
jQuery in Action, 3rd edition