Assignment #123 and Simple File Input

Code

      /// Name: Trent Lane
    /// Period: 6
    /// Program Name: Simple File Input
    /// Date Finished: 3/25/2016
    
    import java.io.File;
    import java.util.Scanner;
    
    public class SimpleInput {
    
        public static void main(String[] args) throws Exception {
        
            String name;
            
            Scanner fileIn = new Scanner(new File("name.txt"));
            
            name = fileIn.nextLine();
            
            fileIn.close();
            
            System.out.println("Your name is " + name + ".");
        }
    }
    


 

Picture of the output

Assignment 71