I am trying to create an application that scans for a file called \"HW4Q3P1.txt\
ID: 3835872 • Letter: I
Question
I am trying to create an application that scans for a file called "HW4Q3P1.txt", and I know that file processing applications require a "throw" variable, and I am pretty sure I have one except it says that the "throws" itself is wrong. Keep in mind this problem isn't complete, I just want to know what i'm doing wrong for the throws value to end that way...
3 //This program scans a file that contains numbers. 4 /It then takes the sum of the numbers and tells you if it is odd or even import java //import an input/output for our program 7 import java. ut il.* //imports java utilities CScanner in this case 9 public class negative Sum 10 public static void main string args) 11 throws FileNotFoundException 14 File Alpha new FileC"HW4Q3P1.txt"); Scanner input new Scanne new File (Alpha) 21 24 27 28 29 30Explanation / Answer
Just remove the braces before that throws keyword after the main().
Thats the only thing you did wrong.
It should be like:
public static void main(String[] args) throws FileNotFoundException
{
...
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.