Passing file path as an argument in Java

前端 未结 4 1946
無奈伤痛
無奈伤痛 2020-12-19 06:01

I have been working with buffering a file on my local drive to parse and obtain certain data. For test purposes I was easily able to do it this way:

public s         


        
4条回答
  •  感动是毒
    2020-12-19 06:32

    You need to do this:

    public static void main(String[] args) {
        String path = args[0];
        // ... 
        File CP_file = new File(path);
        // ... 
    }        
    

提交回复
热议问题