mirror of
https://github.com/Dichgrem/Java.git
synced 2025-12-16 20:42:00 -05:00
update:demo2
This commit is contained in:
15
com/study/demo2/Account_Main.java
Normal file
15
com/study/demo2/Account_Main.java
Normal 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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user