/
Letta21
/
HashMap
Обзор
Документация
Войти
/
Letta21
/
HashMap
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Adress.java
39 строк
976 B
Letta21
update Adress.java
03 ноя 2025, 18:11
03 ноя 2025, 18:11
1e913d9
Код
Авторство
О чём код?
import java.util.Objects; public class Adress { protected String country; protected String city; public Adress(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 == null || getClass() != o.getClass()) return false; Adress address = (Adress) 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 "Adress{" + "country='" + country + '\'' + ", city='" + city + '\'' + '}'; } }