i tried to use java.nio.file package ,but when i use Path class using intellij,i got this error:
can't find symbol (path)
code:
import java.nio.file.Files;
import java.nio.file.Paths;
public class IO_METHODS {
public static void main(String args[]){
Path target= Paths.get("mytext.txt");
Path file= Files.createFile(target);
}
}
why did i get this error ?
You didn't import Path
. Do
import java.nio.file.Path
//...rest of imports and code