Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help writtin to Bianry File!!Please advice!

Status
Not open for further replies.

IrishNewbie

Programmer
Apr 28, 2002
2
IE
Im getting the following error when i try to write a String to a binary file:
Exception in thread "main" java.lang.NullPointerException
at java.io.DataOutputStream.writeChars(Unknown Source)
at UpdateStock.OutArray(UpdateStock.java:105)
at UpdateStock.main(UpdateStock.java:87)

The string im trying to output is a variable in a "book" object.Any Idea on the Problem?????
 
(1) is the variable you're trying to pass initialized (has it been assigned a value in each possible case that it can get to be written) ?

(2) Has your "book" Object been initialized and constructed?

(3) Is the variable you're trying to pass specifically a String or sub class of String?

Hope that helps

JavaDude32
 
Yep your rite,i had two methods for retreiving details and the one i was using wasnt initalizing the correct variables!!little things......Thanx!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top