public class Object {
public static void main(String[] args) {
BankAccount account;
account = getAccount();
JOptionPane.showMessageDialog(null, "The account balance of $"
+ account.getBalance());
System.exit(0);
}
public static BankAccount getAccount() {
String input;
double balance;
input = JOptionPane.showInputDialog("Enter");
balance = Double.parseDouble(input);
return new BankAccount(balance);
}
}
错误是它找不到“BankAccount”符号。我正在尝试返回一个对象并显示。代码有什么问题?