How I can compare each object in an array to identify if they are the same; ex. compare a hockey player to a golfer and output they are not the same, or compare two hockey players to each other and output that they are the same.
I am unsure how to implement this.
players[0] = new BaseballPlayer(...stuff);
players[1] = new FootBall(...stuff);
players[2] = new HockeyPlayer(...stuff);
players[3] = new Golfer(...stuff);
players[4] = new BaseballPlayer(...stuff);
players[5] = new FootBall(...stuff);
players[6] = new HockeyPlayer(...stuff);
players[7] = new Golfer(...stuff);
players[8] = new BaseballPlayer(...stuff);
players[9] = new FootBall(...stuff);
players[10] = new HockeyPlayer(...stuff);
players[11] = new Golfer(...stuff);
players[12] = new BaseballPlayer(...stuff);
players[13] = new FootBall(...stuff);
players[14] = new HockeyPlayer(...stuff);
players[15] = new Golfer(...stuff);