/
dmitry_sh
/
java110_hw019
Обзор
Документация
Войти
/
dmitry_sh
/
java110_hw019
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Address.java
27 строк
585 B
dmitry-sheleg
HW HashSet 0.0.1
18 дек 2025, 08:50
18 дек 2025, 08:50
b23acf8
Код
Авторство
О чём код?
import java.util.Objects; public class Address { protected String country; protected String city; public Address(String country, String city) { this.country = country; this.city = city; } @Override public int hashCode() { return Objects.hash(country, city); } @Override public boolean equals(Object obj) { if (obj == null || getClass() != obj.getClass()) { return false; } Address o = (Address) obj; return this.country.equals(o.country) && this.city.equals(o.city); } }