mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-17 12:51:59 -05:00
16 lines
409 B
Java
16 lines
409 B
Java
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());
|
|
}
|
|
}
|