/* +--------------+ | Song | +--------------+ | String title | | int time | +--------------+ */ //to represent a song class Song implements ISame{ String title; int time; Song(String title, int time){ this.title=title; this.time=time; } //is this song the same as that object public boolean same(ISame that){ if (that instanceof Song) return this.title.equals(((Song)that).title) && this.time==((Song)that).time; else return false; } }