Question: The following program contains 6 mistakes! What are they? public class Oops6 { public static void main (String [] args) { 3 Scanner in =
The following program contains 6 mistakes! What are they?![public class Oops6 { public static void main (String [] args) { 3 Scanner in = new Scanner (](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1606/8/8/6/2685fc7237c153a41606886267751.jpg)
public class Oops6 { public static void main (String [] args) { 3 Scanner in = new Scanner ("example.txt"); 4 countWords (in); 7 // Counts total lines and words in the input scanner. public static void countWords (Scanner input) { Scanner input = new Scanner ("example.txt"); 10 int lineCount = 0; 11 int wordcount = 0; 12 13 while (input.nextLine ()) { 14 String line = input.line (); // read one line 15 lineCount++; 16 while (line.next ()) { 7/ tokens in line 17 String word line.hasNext; 18 wordCount++; 19 20 21 22 2. CO
Step by Step Solution
3.30 Rating (159 Votes )
There are 3 Steps involved in it
Mistakes in Oops6 program 1 line 2 main method must say throws FileNotFoundException when const... View full answer
Get step-by-step solutions from verified subject matter experts
