Results 1 to 2 of 2

Thread: create(java.io.InputStream) in Scanner cannot be applied to (java.io.File)

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    1

    Unhappy create(java.io.InputStream) in Scanner cannot be applied to (java.io.File)

    Ahhh!!!

    Ahem, when I try to compile the attached file, "PhoneDirectory.java", I get the following compilation error message:
    Code:
    PhoneDirectory.java:12: create(java.io.InputStream) in Scanner cannot be applied to (java.io.File)
        Scanner fin = Scanner.create(file);
    After quite a bit of tweaking... I'm right back where I started. I'm a seasoned programmer, as far as concepts are concerned, but rather new to JAVA.

    The error seems to be occuring where a new instance of "Scanner" is supposed to be created. It uses file I/O, and I have only used the Scanner class for the keyboard input in the past.

    Looking at the Scanner class, everything seems to be right to me. I'm probably missing some simple fundamental concept, and I've been pulling my hair out trying to get it... Please help me shed some light on this situation!
    Attached Files Attached Files

Posting Permissions

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



Click Here to Expand Forum to Full Width