/
kseniia1109
/
structure
Обзор
Документация
Войти
/
kseniia1109
/
structure
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Main.java
12 строк
892 B
kseniia1109
create: Book.java, Main.java
13 май 2026, 22:14
Верифицирован
13 май 2026, 22:14
ea8e673
Код
Авторство
О чём код?
public class Main { public static void main(String[] args) { Book book1 = new Book("The blue elephant", 2000, "John Doe", 20); Book book2 = new Book("New world", 2020, "Chris Doe", 501); System.out.println("Is the book '" + book1.title + "' big? " + book1.isBig()); System.out.println("Is the book '" + book2.title + "' big? " + book2.isBig()); System.out.println("Does the book '" + book1.title + "' contains the word 'elephant'? " + book1.matches("elephant")); System.out.println("Does the book '" + book2.title + "' contains the word 'elephant'? '" + book2.matches("elephant")); System.out.println("How much does the book '" + book1.title + "' cost? " + book1.estimatePrice() + " rubles"); System.out.println("How much does the book '" + book2.title + "' cost? " + book2.estimatePrice() + " rubles"); } }