/
digit
/
java-oop-collections-hash
Обзор
Документация
Войти
/
digit
/
java-oop-collections-hash
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Address.java
30 строк
656 B
digit
Create: Main.java, Address.java, Update: README.md
18 июл 2026, 13:25
Верифицирован
18 июл 2026, 13:25
6a412d4
Код
Авторство
О чём код?
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 this.country; } public String getCity() { return this.city; } @Override public int hashCode() { return Objects.hash(this.country, this.city); } @Override public boolean equals(Object obj) { Address o = (Address) obj; return this.country.equals(o.country) && this.city.equals(o.city); } }