/
Liza_S
/
HashMap_and_HashSet_collection
Обзор
Документация
Войти
/
Liza_S
/
HashMap_and_HashSet_collection
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/Address.java
39 строк
856 B
Liza_S
upload files
24 июл 2025, 10:53
24 июл 2025, 10:53
b657e6c
Код
Авторство
О чём код?
import java.util.Objects; @SuppressWarnings("ALL") public class Address { protected String country; protected String city; public Address(String city, String country) { this.city = city; this.country = country; } @Override public int hashCode(){ return Objects.hash(country, city); } @Override public boolean equals(Object obj){ if (obj == null) return false; 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; } }