Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Question Please reply to help Me ......

    Hello every body,....

    I want to write data of more than one object of some class in a text file and the data of each object most be found in a separate line .

    I tried to use "FileWriter" and "PrintWriter" but the problem that faced me is that when the program write in the file it writes only one line of the last object only
    and erase the line that was written before it .

    Please reply me it is so necessary for me :confused:

  2. #2
    angelicsign is offline Member
    Join Date
    Dec 2008
    Posts
    25
    Rep Power
    0

    Default

    o...you need something called "append".
    the syntax i used
    ostream = new FileOutputStream(outputFile,append);
    append is boolean.
    you can find out more in API.

  3. #3
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Question

    thanks dear,....
    but what about the "NullPointerException" ?????????????

  4. #4
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    7

    Default

    either outputFile doesn't exist or append is null or the line your trying to add to it doesn't exist

Similar Threads

  1. Same old Question please reply
    By venat123 in forum New To Java
    Replies: 1
    Last Post: 12-18-2007, 12:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •