Assignemnt #123 and Simple File Input
Code
/// Name: David Shkolnikov
/// Period: 6
/// Program Name: Simple File Input
/// File Name: SimpleFileInput.java
/// Date Finished: 6/6/2016
import java.util.Scanner;
import java.io.File;
public class SimpleFileInput
{
public static void main(String[] args) throws Exception
{
String name;
Scanner fileIn = new Scanner( new File("name.txt"));
name = fileIn.nextLine();
System.out.println("Using my psychic powers, I have determined that ");
System.out.print("your name is " + name);
fileIn.close();
System.out.println(".");
}
}
Picture of the output