/
shuchkin
/
NETOLOGY-HW_HASH
Обзор
Документация
Войти
/
shuchkin
/
NETOLOGY-HW_HASH
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/Address.java
32 строки
713 B
Sergey Shuchkin
0.1
20 дек 2025, 14:00
20 дек 2025, 14:00
1a07012
Код
Авторство
О чём код?
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; } public String getCountry() { return country; } public String getCity() { return city; } @Override public int hashCode() { return Objects.hash(country, city); } @Override public String toString() { return country + "/" + city; } @Override public boolean equals(Object address) { Address addr = (Address) address; return this.country.equals(addr.country) && this.city.equals(addr.city); } }