Question: import java.util.* ; import java.io.* ; /* * * Simple program to test FileNotFoundException */ public class ExceptionTester1 { public static void main(String[] args) {

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!

Step by Step Solution

3.37 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

CHUCK import javaioFile import javaioIOException import javautilScanner public class Chuck public static void mainString args throws IOException Scanner s new Scannernew Filechuckdat int numSets snext... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!