Can't delete files in java?

后端 未结 5 692
广开言路
广开言路 2021-01-24 11:07

I am trying to delete all files in a folder:-

    import java.io.*;
public class AddService {   
    public static void main(String args[]){
        File folder=         


        
5条回答
  •  悲&欢浪女
    2021-01-24 11:56

    There is nothing wrong with your code except you should give the full path.

    try this : File folder=new File("C:\\inputs");

    instead of this line : File folder=new File("inputs");

提交回复
热议问题