import java.util.* ; import java.io.* ; /* * * Simple program to test FileNotFoundException */ public class
Question:
import java.util.* ;
import java.io.* ;
/*
*
* Simple program to test FileNotFoundException
*/
public class ExceptionTester1
{
public static void main(String[] args)
{
//-----------Start below here. To do: approximate lines of code = 6
// Use a try{...}catch(){..} block and open a file "input.txt" (use the File class)
// read in one word from the file (use a Scanner) and print the length of the word
// The file "input.txt" does not exist so you should catch FileNotFoundException and print:
// "File not found"
//-----------------End here. Please do not remove this comment. Reminder: no changes outside the todo regions.
System.out.println("Expected:File not found") ;
}
}
Please have the expected output on screenshot along with making sure your output code is well formatted!
Probability & Statistics for Engineers & Scientists
ISBN: 978-0130415295
7th Edition
Authors: Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying