Assignment #123: File Input

Code

  import java.io.File;
import java.util.Scanner;

public class FileInput {

    public static void main (String[] args) throws Exception {
    
        Scanner input = new Scanner(new File ("Name.txt"));
        
        String firstname, lastname;
        
        System.out.println("Checking the file...your name is: ");
        firstname = input.nextLine();
        lastname = input.nextLine();
        
        System.out.println(firstname + " " + lastname);
        
    }
        
}
    

Pictures of the output