Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How Do I set up Scanner for .dat file

807601Apr 4 2008 — edited Apr 7 2008
I was involved in a Computer Science competition, and I'm trying to figure out the questions. Part of the hand on section requires you to get info from a .dat file. Part of the code I used is:
Scanner trick = new Scanner(new File("trick.dat"));
        int i= trick.nextInt();
I think I did that okay, but I get a FileNotFoundException. What should I do to the file/code to make it work?

Edited by: ffccguy on Apr 4, 2008 3:10 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2008
Added on Apr 4 2008
9 comments
1,005 views