/
digit
/
java-oop-polymorphism-abstract
Обзор
Документация
Войти
/
digit
/
java-oop-polymorphism-abstract
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
task2/Main.java
25 строк
836 B
digit
Create: Account.java, CreditAccount.java, Main.java, SimpleAccount.java, Logger.java, Main.java, SimpleLogger.java, SmartLogger.java
09 июл 2026, 16:50
Верифицирован
09 июл 2026, 16:50
e09293a
Код
Авторство
О чём код?
package task2; public class Main { public static void main(String[] args) { Logger simple = new SimpleLogger(); simple.log("Application started"); simple.log("An error occurred while reading file"); System.out.println(); Logger smart = new SmartLogger(); smart.log("Application started"); // INFO#1 smart.log("User logged in"); // INFO#2 smart.log("Error: disk full"); // ERROR#3 smart.log("Connection to DB failed"); // INFO#4 smart.log("Fatal ERROR in module X"); // ERROR#5 System.out.println(); // Independent counters per instance Logger anotherSmart = new SmartLogger(); anotherSmart.log("First message on a new logger"); // INFO#1 } }