Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. package readfile;
  2. import java.util.Comparator;
  3.  
  4. public class Album implements Comparator<Album> {
  5.  
  6.  
  7. public String album;
  8. public String artist;
  9.  
  10.  
  11. public Album(String album, String artist) {
  12. this.album = album;
  13. this.artist = artist;
  14. }
  15.  
  16. @Override
  17. public int compare(Album o1, Album o2) {
  18. return (o1.album == o2.album && o1.artist == o2.artist ? 1 : 0);
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement