Hey guys I have this code snippet and I want to read from this file and print the contents of my text file (Transcript.txt) to the screen. I don't have any errors but when I run the program it prints "Display it to the standard output" instead of whats on my text file could I please have some assistance with this.
import java.io.File;
import java.util.Scanner;
public class GPAapp {
public static void main(String[] args) {
Scanner reader = null;
try{
reader = new Scanner(new File("Transcript.txt"));
}
catch(Exception e){
System.out.println("File does not exist");
}
while(reader.hasNext()){
System.out.print(reader.next());
}
reader.close();
}
}