Why there is Error like CANNOT FIND SYMBOL in Output? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why there is Error like CANNOT FIND SYMBOL in Output?

public class Main { static void sayHello(String name) { System.out.println("Hello " + name); } public static void main(String[ ] args) { Scanner hep=new Scanner(System.in); String name=hep.nextLine(); sayHello(name); } } OUTPUT:Main.java:7: error: cannot find symbol public static void main(String[ ] args) {Scanner hep=new Scanner(System.in);String name=hep.nextLine(); ^ symbol: class Scanner location: class Main Main.java:7: error: cannot find symbol public static void main(String[ ] args) {Scanner hep=new Scanner(System.in);String name=hep.nextLine(); ^ symbol: class Scanner location: class Main 2 errors

26th May 2022, 11:51 AM
We Doru
We Doru - avatar
3 Answers
+ 1
Thanks
26th May 2022, 11:58 AM
We Doru
We Doru - avatar
0
I FORGOT. What A simple Mistake
26th May 2022, 11:58 AM
We Doru
We Doru - avatar
- 1
Import util package then you will able to use all classes an interfaces available in util
27th May 2022, 7:27 PM
sree harsha
sree harsha - avatar