You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
577 B

public class TestBankAccount {
public static void main(String[] args){
BankAccount account = new BankAccount("abc123","zj");
System.out.println("当前余额:" + account.getBalance());
account.deposit(500);
account.deposit(-100);
account.withdraw(200);
account.withdraw(400);
account.withdraw(-50);
account.setOwnerName("ZJ123");
System.out.println("修改后户主:" + account.getOwnerName());
System.out.println("当前余额:" + account.getBalance());
}
}