update:demo2

This commit is contained in:
dichgrem
2025-10-31 17:01:12 +08:00
parent af1ea3e24e
commit d765c1a219
8 changed files with 214 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
package com.study.demo2;
public class Main {
public static void main(String[] args) {
Account acc1 = new Account("A001", "张三", 1000);
Account acc2 = new Account("A002", "李四", 500);
acc1.deposit(200);
acc1.withdraw(100);
acc1.transfer(acc2, 300);
System.out.println("账户1余额:" + acc1.getBalance());
System.out.println("账户2余额:" + acc2.getBalance());
}
}