Yuvraj Waghray
public class Person {
private final String first;
private final String last;
public Person(String first, String last) {
this.first = first;
this.last = last;
}
public String getFirst() {
return first;
}
public String getLast() {
return last;
}
@Override
public String toString() {
return "Person( first=" + first + "last=" + last + ")";
}
@Override
public int hashCode() {
return Objects.hash(first, last);
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Person person = (Person) obj;
return Objects.equals(first, person.first)
&& Objects.equals(last, person.last);
}
public Person copy(Object obj) {
return null;
}
}
JVM
Android
Browser
Native