/
SofiMut
/
simpleAndCredit
Обзор
Документация
Войти
/
SofiMut
/
simpleAndCredit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Account.java
25 строк
461 B
Софья Степанова
upload files
27 июн 2025, 06:58
27 июн 2025, 06:58
c1a92ba
Код
Авторство
О чём код?
public abstract class Account { public long balance; abstract boolean add(long amount); abstract boolean pay(long amount); public boolean transfer(Account account, long amount) { if (pay(amount)) { if (account.add(amount)) { return true; } add(amount); } return false; } public long getBalance() { return balance; } }