style:fmt

This commit is contained in:
dichgrem
2025-11-15 13:30:17 +08:00
parent c20e8949a5
commit 41e6b71bd7
33 changed files with 549 additions and 543 deletions

View File

@@ -1,36 +1,36 @@
package com.study.demo2;
public class Account {
private String accountId;
private String owner;
private double balance;
private String accountId;
private String owner;
private double balance;
public Account(String accountId, String owner, double balance) {
this.accountId = accountId;
this.owner = owner;
this.balance = balance;
}
public Account(String accountId, String owner, double balance) {
this.accountId = accountId;
this.owner = owner;
this.balance = balance;
}
public void deposit(double amount) {
if (amount > 0) {
balance += amount;
}
public void deposit(double amount) {
if (amount > 0) {
balance += amount;
}
}
public void withdraw(double amount) {
if (amount > 0 && amount <= balance) {
balance -= amount;
}
public void withdraw(double amount) {
if (amount > 0 && amount <= balance) {
balance -= amount;
}
}
public void transfer(Account target, double amount) {
if (amount > 0 && amount <= balance) {
this.balance -= amount;
target.balance += amount;
}
public void transfer(Account target, double amount) {
if (amount > 0 && amount <= balance) {
this.balance -= amount;
target.balance += amount;
}
}
public double getBalance() {
return balance;
}
}
public double getBalance() {
return balance;
}
}