/
SamMih
/
HOMEWORK11_HashSet_HashMap
Обзор
Документация
Войти
/
SamMih
/
HOMEWORK11_HashSet_HashMap
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Address.java
38 строк
794 B
SamMih
HOMEWORK11_HashSet_HashMap
21 июл 2025, 12:17
21 июл 2025, 12:17
26f7553
Код
Авторство
О чём код?
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) { Address o = (Address) obj; return country.equals(o.country) && city.equals(o.city); } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } }