63 076
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #20640 in Java | JSP | JSF for nohra

Question #20640
If you try to open a file that does not exist using Scanner constructor, what type of exception will be thrown?
A) ScannerException
B) FileNotFoundException
C) FileException
D) NotFoundException
Expert's answer
If you try to opena file that does not exist using Scanner constructor, FileNotFoundException is generated.
for example:

public class main {

publicstatic void main(String[] args) throws FileNotFoundException
{
Scanners=new Scanner(new File(""));
}
}

if you try to run this code, it will generateFileNotFoundException

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions