Error handling of Scanner

Report a typo

Look at the code below. What exceptions (if any) may be thrown in its two last lines?

File file = new File(pathToFile); // pathToFile is non null String variable
Scanner scanner = new Scanner(file);
String line = scanner.nextLine();
Select one option from the list
___

Create a free account to access the full topic