Assignemnt #127 and Displaying a Final
Code
///name: Mark Katz
///period: 6
///Program name: Displaying a File
///file name: DisplayingAFile.java
///date finished: 6/2/16
import java.util.Scanner;
import java.io.File;
public class DisplayingAFile {
public static void main(String[] args) throws Exception{
Scanner kb = new Scanner(System.in);
String fn;
System.out.println("What file would you like to scan? ");
fn = kb.next();
Scanner reader = new Scanner(new File(fn));
while (reader.hasNext()) {
String l = reader.nextLine();
System.out.println(l);
}
}
}