+ 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 Antworten
+ 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