我最近在我的Mac上安裝了eclipse,我在課堂上與它混在一起。我在我的第一行打印行上不斷髮生錯誤的構造錯誤,並在我的主要聲明中出現了一些語法錯誤。我真的不知道怎麼回事。Java錯位結構
import static java.lang.System.out;
import java.util.Scanner;
public static void main (string args[])
{
double a, b, c, d, e, f;
Scanner input = new Scanner();
out.println(" Please enter the first number: ");
a = imput.nextDouble;
out.println("Please enter the second number: ");
b = imput.nextDouble;
out.println ("Please enter the third number : ");
c = imput.nextDouble;
out.println ("Please enter in fourth number : ");
d = imput.nextDouble;
out.println(" Please enter in fifth number : ");
e = imput.nextDouble;
double sum = a + b + c + d + e;
}
這還沒完,但據我可以看到我有值,我的所有變量,一切都被關閉的事情應該是這樣。
您還沒有一個類下保持它。 – 2013-04-22 15:29:13
您的代碼中存在很多問題,在我的回答中,您會看到完整的運行代碼,修復程序和解釋錯誤。 – Jops 2013-04-22 15:38:18
你應該真正密切關注你在課堂上學習的內容和/或使用書籍或教程。 Java不是一種可以通過「無所事事」正確學習的語言 – madth3 2013-04-22 23:58:25