/
msigin77
/
Home_work12_1
Обзор
Документация
Войти
/
msigin77
/
Home_work12_1
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Address.java
36 строк
737 B
msigin77
д\з_12_1
25 дек 2025, 09:19
25 дек 2025, 09:19
b37d6cf
Код
Авторство
О чём код?
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 String getCity() { return city; } @Override public boolean equals(Object o) { Address address = (Address) o; return country.equals(address.country) && city.equals(address.city); } @Override public int hashCode() { return Objects.hash(country, city); } @Override public String toString() { return country + ", " + city; } }