我在Eclipse中編寫這段代碼,但它告訴我它在2行有多個標記。我試圖解決這個問題,但會出現更多標記。出現的錯誤是在第15行和18在骰子代碼中的這條線上的多個標記(Eclipse)
public class Cup {
private Dice d1 = new Dice();
private Dice d2 = new Dice();
public void roll(){
d1.roll();
d2.roll();
}
public int getvalue1(){
return d1.getValue();
}
public int getvalue2(){
return d2.getValue();
}
public int getSum(){
return d1.getValue() + d2.getValue();
}
}
哪條線是15和18? – 2014-10-07 17:06:36
什麼是確切的標記信息? – Leistungsabfall 2014-10-07 17:07:43
此行有多個標記 \t - 重複的本地變量$缺少$ \t - 語法錯誤,插入「;」完成聲明 \t - 方法getSum()未定義類型杯 \t - 語法錯誤,插入「;」完成LocalVariableDeclarationStatement \t - 參數$ missing $的非法修飾符;只有最終被允許 \t - 語法錯誤,插入「VariableDeclarators」在這行完成 \t LocalVariableDeclaration – user4118143 2014-10-07 17:09:23