/
DanLiz456
/
DZ17
Обзор
Документация
Войти
/
DanLiz456
/
DZ17
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Address.java
41 строка
933 B
Даниил Ушаков
upload files
01 дек 2025, 08:56
01 дек 2025, 08:56
c558ba2
Код
Авторство
О чём код?
import java.util.Objects; public class Address { private final String country; private final 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 boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Address)) 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); } @Override public String toString() { return "Address{" + "country='" + country + '\'' + ", city='" + city + '\'' + '}'; } }