Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* file 1 */
- class LueLinks {
- int value;
- public LueLinks(int value) {
- this.value=value;
- }
- @Override public boolean equals(LueLinks other) {
- if(other.value == value) {
- return true;
- }
- return false;
- }
- @Override public int hashCode() {
- return value;
- }
- }
- /* file 2 */
- class Starter {
- public static void main(String args[]) {
- Set<LueLinks> set = new HashSet<LueLinks>();
- set.add(new LueLinks(1));
- set.add(new LueLinks(2));
- set.add(new LueLinks(2));
- System.out.println(set.size());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement