This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes stringbuffer :nullpointerexception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "stringbuffer :nullpointerexception" Watch "stringbuffer :nullpointerexception" New topic
Author

stringbuffer :nullpointerexception

f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
hey guys,



this is the first time i have used StringBuffer. if anyone is still awake ... thanks.

nikita


Imagination is more important than knowledge "Albert Einstein"
Balasubramani Dharmalingam
Ranch Hand

Joined: Dec 06, 2004
Posts: 116
Variable sb is not yet initialized, default value will be null. So you are getting null pointer exception. Replace the sb declaration with following code.Then it should work


Balasubramani SD,<br />SCJP 1.4,SCWCD 1.4,SCJP 5.0<br /><a href="http://sd.balasubramani.googlepages.com" target="_blank" rel="nofollow">www.sd.balasubramani.googlepages.com</a>
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
shows you how tired i am. thanks Balasubramani. namaste.
[ April 09, 2008: Message edited by: f. nikita thomas ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Originally posted by f. nikita thomas:
shows you how tired i am. thanks Balasubramani. namaste.


Rest, the code will wait for you
f. nikita thomas
Ranch Hand

Joined: Mar 02, 2008
Posts: 87
couldn't wait ...



unfortunately i set the bar high for myself. this will teach me some humility. but your right, enough for now. shalom.

nikita
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: stringbuffer :nullpointerexception
 
Similar Threads
Calling object methods using reference to variables
is there another way?
trying ot read a line but instead reading a file
Characters in String : Unicode 16-bit to custom 32-bit
classic dictionary / hash table issue