/
Marina_Ryazanova
/
map
Обзор
Документация
Войти
/
Marina_Ryazanova
/
map
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/Address.java
25 строк
614 B
Ryazanova_MV
правки
18 сен 2025, 21:08
18 сен 2025, 21:08
b712c2c
Код
Авторство
О чём код?
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 boolean equals(Object o) { if (this == o) return true; 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() { return Objects.hash(country, city); } }