Assignemnt #123 Simple File Input
Code
///Name: Prooz Fereydouni
///Period: 7
///Project Name: Simple File Input
///File Name: SFI.java
///Date: 5/28/2016
import java.io.File;
import java.util.Scanner;
public class SFI {
public static void main(String[] args) throws Exception {
String name1, name2;
Scanner fileIn = new Scanner(new File("name.txt"));
name1 = fileIn.next();
name2 = fileIn.next();
fileIn.close();
System.out.println("Using my psychic powers (aided by reading data from the file), I have Determined that your name is " + name1 + " " + name2);
}
}
Picture of the output