public class TemperatureChanger
{
public static void main(String[]args)
{
Scanner keyboard = new Scanner(System.in);
int c;
int f;
int tempFaren;
System.out.println("Enter temperature in celcius");
c = keyboard.nextInt();
tempFaren = (9 *c)/5 + 32;
System.out.println(" In Fahrenheit that is " + tempFaren);
}
}
編譯期間收到錯誤TemperatureChanger.java:7: cannot find symbol Scanner keyboard = new Scanner(System.in)
。我需要做些什麼來解決這個問題。如何修復Java(Scanner)中的'找不到符號'錯誤?
你一直在得到它,可能是因爲你沒有修復產生它的錯誤。看起來您缺少Scanner類的導入。 – bmargulies 2013-04-27 01:08:35