Results 1 to 6 of 6
  1. #1
    Quizzle23 is offline Member
    Join Date
    Feb 2011
    Posts
    34
    Rep Power
    0

    Default Reading from a file.

    When a program reads from a file do you have to use BufferedWriter and BufferedReader, FileReader, FileWriter, and InputStreamReader? Or is there another way?

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    You use those classes(built in I/o). Check out the basic io tutorial on suns tutorial site for how each work.

  3. #3
    Quizzle23 is offline Member
    Join Date
    Feb 2011
    Posts
    34
    Rep Power
    0

    Default

    Yes I have imported IO and I am using them, I just want to know if there is another way without using them.

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Not that i know of, you can use the new io package but that's probably a bit complex if you don't have a good understanding of java.

  5. #5
    Quizzle23 is offline Member
    Join Date
    Feb 2011
    Posts
    34
    Rep Power
    0

    Default

    Oh ok thanks for the info.

  6. #6
    JavaHater is offline Senior Member
    Join Date
    Dec 2010
    Posts
    165
    Rep Power
    5

    Default

    Quote Originally Posted by Quizzle23 View Post
    When a program reads from a file do you have to use BufferedWriter and BufferedReader, FileReader, FileWriter, and InputStreamReader? Or is there another way?
    Just use Scanner.

Similar Threads

  1. Reading file external to jar file
    By nn12 in forum New To Java
    Replies: 6
    Last Post: 02-04-2011, 06:46 AM
  2. reading a file and writing to a file....help!!!!
    By java_prgr in forum New To Java
    Replies: 3
    Last Post: 07-26-2010, 07:53 PM
  3. Replies: 9
    Last Post: 10-20-2009, 11:52 AM
  4. Replies: 3
    Last Post: 05-10-2009, 12:31 AM
  5. Reading XML from file
    By chriscant in forum New To Java
    Replies: 0
    Last Post: 03-17-2009, 02:34 PM

Posting Permissions

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