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.

21 lines
701 B

public class BankAccountTest {
// 程序入口:main 方法
public static void main(String[] args) {
// 1. 创建一个 BankAccount 对象(调用构造方法)
BankAccount account = new BankAccount("622202123456789", "张三");
// 2. 测试存款
account.deposit(1000);
// 3. 测试取款
account.withdraw(300);
// 4. 测试修改户主姓名
account.setOwnerName("张三丰");
// 5. 测试查询信息
System.out.println("账户号:" + account.getAccountNumber());
System.out.println("户主:" + account.getOwnerName());
System.out.println("余额:" + account.getBalance());
}
}