aspose file tools*
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 Spring in Action this week in the Spring 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
 
Consider Paul's rocket mass heater.
 
subject: stringbuffer :nullpointerexception