/
KuznetcovVS
/
hwHashMap
Обзор
Документация
Войти
/
KuznetcovVS
/
hwHashMap
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Address.java
26 строк
670 B
KuznetcovVS
HashMAp
27 мар 2025, 16:59
27 мар 2025, 16:59
72bbef3
Код
Авторство
О чём код?
public class Address { private String country; private String city; public Address(String country, String city) { this.country = country; this.city = city; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Address address = (Address) o; return country.equals(address.country) && city.equals(address.city); } @Override public int hashCode() { return 31 * country.hashCode() + city.hashCode(); } public String getCountry() { return country; } }