java cannot find symbol class Scanner
java cannot find symbol class Scanner
I am getting the below error
Error(14, 9) java: cannot find symbol symbol: class Scanner location: class sample.JavaProgram
vito Selected answer as best September 21, 2021
You need to import the Scanner class to your program so that you can create an object with the help of it. Add the below line at the top of your program,
import java.util.Scanner;
Execute the program now and the error should not be thrown.
vito Selected answer as best September 21, 2021