Using BufferedReader.readLine() in a while loop properly

后端 未结 7 1597
无人共我
无人共我 2020-11-27 19:35

So I\'m having an issue reading a text file into my program. Here is the code:

     try{
        InputStream fis=new FileInputStream(targetsFile);
        Bu         


        
相关标签:
7条回答
  • 2020-11-27 20:22

    You can use a structure like the following:

     while ((line = bufferedReader.readLine()) != null) {
                System.out.println(line);
            }
    
    0 讨论(0)
提交回复
热议问题