0
Scanner error in Java
In my code, it keeps giving me an error like. "/Playground/Program.java:2: error: '{' expected public class Program" But all I did was just import a Scanner What am I doing wrong for this to happen? public class Program import java.util.Scanner; { public static void main(String[] args) { Scanner owo = new Scanner(System.in); System.out.println("Do you think coding is hard?"); String input = owo.nextLine(); } }
1 Answer
+ 3
Err3c
import should be at top not inside class and at bottom.