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){
In your IDE right click on the file you want to read and choose "copy path" then paste it into your code.
Note that windows hides the file extension so if you create a text file "myfile.txt" it might be actually saved as "myfile.txt.txt"