我看不到這個短類的問題。我得到8類,接口或枚舉預期的錯誤。謝謝繼續收到錯誤類別,接口或枚舉預期
public class BankAccount {
public BankAccount {
private double balance = 0;
}
public BankAccount(double balanceIn) {
private double balance = balanceIn;
}
public double checkBalance {
return balance;
}
public void deposit(double amount) {
if(amount > 0) balance += amount;
}
public void withdraw(double amount) {
if(amount <= balance) balance -= amount;
}
}
你或許應該標記這與實際的語言(Java?)。 –