openInputFile public static java.io.File openInputFile(java.util.Scanner kb) The openInputFile method prompts the user f
Posted: Sun Jul 03, 2022 11:23 am
openInputFile public static java.io.File openInputFile(java.util.Scanner kb) The openInputFile method prompts the user for a filename, attempts to open that filename, if successful a File object containing information on the file is returned. Post The carriage return is stripped from the input buffer at exit of the method - Meaning the input buffer is left empty Parameters: kb - The Scanner object representing the keyboard Returns: File - Representing an object to the open file Throws: java.lang.IllegalArgumentException - if the Scanner object is null openInputFile public static java.io.File openInputFile(java.lang.String filename) The openInputFile method receives a filename, attempts to open that filename, if succesful a File object containing information on the file is returned. Parameters: filename - The String representing the filename Returns: File - Representing an object to the open file Throws: java.lang.IllegalArgumentException - if the String object is null - if the String is empty java.lang.RuntimeException - if the file could not be opened java.lang. IllegalArgumentException