/
sc0rpi0n2001
/
HW_HASH
Обзор
Документация
Войти
/
sc0rpi0n2001
/
HW_HASH
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Address.java
24 строки
619 B
sc0rpi0n2001
upload files
24 фев 2025, 23:43
24 фев 2025, 23:43
9c6f021
Код
Авторство
О чём код?
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 country.equals(address.country) && city.equals(address.city); } @Override public int hashCode() { return Objects.hash(country, city); } }