how to find your file path java code example
Example 1: get file path java
File file = new File("yourfileName");
String path = file.getAbsolutePath();
Example 2: java cannot find file path
public static void main(String[] args) {
Scanner scanner = new Scanner(ScannerReadFile.class.getResourceAsStream("CardNative.java.txt"));
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
System.out.println(line);
}
scanner.close();
}
}