Prog 127: Displaying a File
//Name: Ilana Levy
//Period: 5
//Program Name: Displaying a File
//File Name: displayFile.java
//Date Finished: 2/19/2016
import java.util.Scanner;
import java.io.File;
public class displayFile
{
public static void main( String[] args ) throws Exception
{
Scanner scan = new Scanner( System.in );
System.out.print( "Open which file: " );
String which = scan.next();
Scanner fileIn = new Scanner( new File(which));
while ( fileIn.hasNext() )
{
System.out.println( fileIn.nextLine());
}
}
}