int n;
Scanner keyboard = new Scanner(System.in);
n = keyboard.nextInt();
My compiler is pointing to the dot in the statement n=keyboard.nextInt(); and providing a "cannot find symbol" error. Any suggestions? Thanks
int n;
Scanner keyboard = new Scanner(System.in);
n = keyboard.nextInt();
My compiler is pointing to the dot in the statement n=keyboard.nextInt(); and providing a "cannot find symbol" error. Any suggestions? Thanks
A minimal working example:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int n;
Scanner keyboard = new Scanner(System.in);
n = keyboard.nextInt();
System.out.println(n);
}
}
Don't forget to import java.util.scanner
.