Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By jim829

Thread: Is there any possible to declare two DataInputStream??

  1. #1
    ben2470 is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Is there any possible to declare two DataInputStream??

    I mean i need to access to two txt file at the same time so i did this in method:

    DataInputStream din= new DataInputStream(FileInputStream("vip.txt"));
    DataInputStream din2= new DataInputStream(FileInputStream("corporate.txt"));


    But there are errors when i compile and they pointing to these two lines.

    What Happened?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,618
    Rep Power
    5

    Default Re: Is there any possible to declare two DataInputStream??

    Of course its possible. Try putting a new in front of your FileInputStream constructors.

    Regards,
    Jim
    Last edited by jim829; 08-03-2014 at 08:51 PM.
    ben2470 likes this.
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    ben2470 is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Re: Is there any possible to declare two DataInputStream??

    Thanks!

Similar Threads

  1. Error in DataInputStream
    By sanshik in forum JCreator
    Replies: 8
    Last Post: 07-10-2011, 02:37 PM
  2. DataInputStream
    By robs in forum Java Gaming
    Replies: 7
    Last Post: 04-14-2011, 06:27 PM
  3. Problem with DataInputStream
    By ZivonHunter in forum New To Java
    Replies: 1
    Last Post: 11-21-2008, 05:10 AM
  4. DataInputStream readLine()
    By ravian in forum New To Java
    Replies: 2
    Last Post: 11-26-2007, 10:44 PM
  5. Replies: 1
    Last Post: 08-07-2007, 07:16 AM

Tags for this Thread

Posting Permissions

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