Reading a File From the Computer

前端 未结 1 1847
情深已故
情深已故 2020-12-12 01:46

Now I have this error:

Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsException: 4 at Lotto1.main(Lotto1.java:37)

Line 37: arr[count][0] =

相关标签:
1条回答
  • 2020-12-12 02:19

    You didn't put the right path into the FileReader only into File f, you can pass f into the Filereader instead of repeating the path:

    File f = new File("D:\\database_lotto.txt");
    [...]
    BufferedReader reader = new BufferedReader(new FileReader(f));
    
    0 讨论(0)
提交回复
热议问题