Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package readfile;
- import java.util.Comparator;
- public class Album implements Comparator<Album> {
- public String album;
- public String artist;
- public Album(String album, String artist) {
- this.album = album;
- this.artist = artist;
- }
- @Override
- public int compare(Album o1, Album o2) {
- return (o1.album == o2.album && o1.artist == o2.artist ? 1 : 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement