我的nextDouble();扫描仪给我一个“找不到符号”错误

时间:2020-08-05 03:41:28

标签: java input

我正在为我的计算机科学课做一个项目,遇到了一个让我无法继续进行的问题,我试图做一个非常简单的用户输入问题,但我一直遇到错误。这是我的代码和错误:

import java.util.*;

public class BeekeepingIncome{

   public static void main(String [] args)
   {
   double rawHoney;
   double honeyCombs; 
   double rent = 534.99;
   
   Scanner scanner = new Scanner(System.in);
   
   System.out.println("How much honey in pounds was purchased?");
   rawHoney = nextdouble();
   System.out.println("How many honey combs in pounds were purchased?");

   
   
   
   
   }
   
}

BeekeepingIncome.java:20: error: cannot find symbol
   rawHoney = nextDouble();
              ^
  symbol:   method nextDouble()
  location: class BeekeepingIncome
1 error

有什么办法可以解决这个问题?

1 个答案:

答案 0 :(得分:2)