- Openinputfile Public Static Java Io File Openinputfile Java Util Scanner Kb The Openinputfile Method Prompts The User F 1 (41.4 KiB) Viewed 21 times
openInputFile public static java.io.File openInputFile(java.util.Scanner kb) The openInputFile method prompts the user f
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
openInputFile public static java.io.File openInputFile(java.util.Scanner kb) The openInputFile method prompts the user f
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