/
lady
/
hashmap
Обзор
Документация
Войти
/
lady
/
hashmap
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Address.java
35 строк
894 B
lady
upload files
31 июл 2025, 14:25
31 июл 2025, 14:25
3e8f5d7
Код
Авторство
О чём код?
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 (country.toLowerCase().hashCode() * 31) + city.toLowerCase().hashCode(); } @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.equalsIgnoreCase(address.country) && city.equalsIgnoreCase(address.city); } @Override public String toString() { return country + ", " + city; } }