/
itokar98
/
HomeWorkHash
Обзор
Документация
Войти
/
itokar98
/
HomeWorkHash
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/Address.java
42 строки
934 B
Ilya Tokar
first commint
22 июл 2025, 23:16
22 июл 2025, 23:16
8d98f64
Код
Авторство
О чём код?
import java.util.Objects; public class Address { private String country; private String city; public Address(String country, String city) { this.country = country; this.city = 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; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; Address address = (Address) o; return Objects.equals(country, address.country) && Objects.equals(city, address.city); } @Override public int hashCode() { int result = Objects.hashCode(country); result = 31 * result + Objects.hashCode(city); return result; } }