/
FreeZZZeee
/
the_ninth_task
Обзор
Документация
Войти
/
FreeZZZeee
/
the_ninth_task
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/CreditAccount.java
20 строк
546 B
ЛЕОНИД ВИТАЛЬЕВИЧ ЯКОВЛЕВ
first_commit
09 фев 2026, 11:25
09 фев 2026, 11:25
54a9e8f
Код
Авторство
О чём код?
public class CreditAccount extends Account { private long creditLimit; public CreditAccount(long creditLimit) { if (creditLimit <= 0) { System.out.println("Кредитный лимит должен быть положительным"); } this.creditLimit = creditLimit; } @Override public boolean canPay(long amount) { return this.getBalance() - amount >= -creditLimit; } @Override public boolean canAdd(long amount) { return this.getBalance() < 0; } }