Assignemnt #123 and Simple File Input
Code
/// Name: Brian Phillips
/// Period 5
/// Program Name: Simple File Input
/// File Name: input.java
/// Date Finished: 5/30/2016
import java.io.File;
import java.util.Scanner;
class input
{
public static void main (String [] args) throws Exception
{
String first, last;
System.out.println("Your name be.. ");
Scanner fileIn = new Scanner(new File("name.txt"));
first = fileIn.nextLine();
last = fileIn.next();
fileIn.close();
System.out.println(first + " " + last);
}
}
Picture of the output