View Single Post
Join Date: Oct 2004
Posts: 26
Reputation: SyLk is an unknown quantity at this point 
Solved Threads: 0
SyLk SyLk is offline Offline
Light Poster

Re: how to use scanner correctly

 
0
  #4
Sep 25th, 2008
  1. public class praogram1
  2. {
  3. Scanner scanner = new Scanner (new File ("t.txt"));
  4. public static void main(String[] args)
  5. {
  6. }
  7. }

ok..im tryin to define it at the class level and i run into this issue now. How do i throw an IOException at this level

Default constructor cannot handle exception type FileNotFoundException thrown by implicit super constructor. Must define an explicit constructor
Reply With Quote