76 289
Assignments Done
Successfully Done
In May 2019

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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions