Skip to content

Instantly share code, notes, and snippets.

@abyx
Created November 24, 2010 20:01
Show Gist options
  • Select an option

  • Save abyx/714291 to your computer and use it in GitHub Desktop.

Select an option

Save abyx/714291 to your computer and use it in GitHub Desktop.
public class Account {
private final String name;
private final int id;
public Account(String name, int id) {
this.name = name;
this.id = id;
}
public int getId() { return id; }
public String getName() { return name; }
@Override public int hashCode() {
// Standard implementation with "name" & "id"
}
@Override public boolean equals(Object obj) {
// Standard implementation with "name" & "id"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment