The system cannot find the file specified in java

前端 未结 8 870
轮回少年
轮回少年 2020-11-28 08:52

I am making a program that opens and reads a file. This is my code:

import java.io.*;

public class FileRead{
    public static void main(String[] args){
           


        
8条回答
  •  清酒与你
    2020-11-28 09:32

    Try to list all files' names in the directory by calling:

    File file = new File(".");
    for(String fileNames : file.list()) System.out.println(fileNames);
    

    and see if you will find your files in the list.

提交回复
热议问题