Java 找不到扫描仪类型的符号变量键盘

Java 找不到扫描仪类型的符号变量键盘,java,compiler-errors,java.util.scanner,Java,Compiler Errors,Java.util.scanner,我一直找不到符号错误。我尝试了之前建议的一切,但都没有成功。我觉得我错过了一些非常简单的事情 import java.util.Scanner; public class XXX { public static void main(String[] args) { String playerName1; final int MIN_SCORE = 19; final int MAX_SCORE = 51; int score;

我一直找不到符号错误。我尝试了之前建议的一切,但都没有成功。我觉得我错过了一些非常简单的事情

import java.util.Scanner;

public class XXX
{
   public static void main(String[] args)
   {
      String playerName1;
      final int MIN_SCORE = 19;
      final int MAX_SCORE = 51;
      int score;

      Scanner keyboard = new Scanner(System.in);

      System.out.println();
      System.out.print("Enter you name: ");
      playerName1 = keyboard.next();

      System.out.print("Welcome" + playerName1 + "to the game of guts! ");

      System.out.println();

      System.out.print("Enter winning Score(between 20 - 50): ");
      score = keyboard.Int();

   }
}



ProgrammingProject3.java:36: error: cannot find symbol
      score = keyboard.Int();
                      ^
  symbol:   method Int()
  location: variable keyboard of type Scanner

A确实没有
int()
方法。它被称为。

它是
keyboard.nextInt()