java cannot find symbol class Scanner

Solved1.52K viewsJavajava 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

Share:
vito Selected answer as best September 21, 2021
0

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.

Share:
vito Selected answer as best September 21, 2021
0
You are viewing 1 out of 1 answers, click here to view all answers.