java coding 8

Write a Java program that prompts the user for a filename and attempts to open the file as follows: Scanner infile = new Scanner(new FileInputStream(filename));

If there an exception thrown as a result, the program should prompt the user to reenter the filename until a valid filename exists. (Make sure to have a textfile as part of the project to open. It should be in the main project folder, not in any of the project subfolders.) Go to the Java API (link in Blackboard) and look up the constructor for the FileInputStream class to determine the exceptions

that the constructor throws.

Note that your program must import both the FileInputStream class, AND the class of the exception type that the constructor of this class throws. Therefore, you must either use:

import* – to import ALL of the classes in the package or


Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.