/* The program demonstrate a simple File Input that appends data In addition, it allows the user to create the name of file * */ import java.util.*; // Needed for Scanner class import java.io.*; // Needed for File input and output public class FileAppend { public static void main(String[] args)throws IOException { Scanner key = new Scanner(System.in); // Asks the user for how many name will be enter System.out.println("How many names are you going to enter: "); int num = key.nextInt(); // Ask the user for the name of the file System.out.println("Enter the name of the file: "); String filename = key.next(); // Opens the file or create a file if it doesn't exist FileWriter fw = new FileWriter(filename, true); PrintWriter pw = new PrintWriter(fw); for(int i=0; i