Design a class named simpletrack


Problem

Play lists could be used to represent lists of songs, podcasts, or videos that a user wants to play in a particular order. Code like this might be used in an mp3 player or podcast app or on a streaming music app service such as Pandora or Spotify. For this assignment we will be focusing on the example of an app that plays music, but it's easily extensible to other examples of audio or video that you can think of.

The SimpleTrack class

For this problem design a class named SimpleTrack. This class must implement the Track interface given in the project. It is up to you how to represent the member variables of your SimpleTrack class, but it must implement all of the methods given in the Track interface.

In addition, your SimpleTrack class must implement the following methods not provided in the interface, but which are inherited from the Object class:

1) equals(Object obj) - should return a true value if the name, artist and album in the two tracks are the same. Otherwise should return a false value.

2) toString() - should return a string that contains the artist name followed by the track name followed by the album name with a single slash between each of them. The whole String should be surrounded by single quote marks (i.e. 'Elvis Presley / Blue Suede Shoes / Elvis Presley: Legacy Edition').

3) hashCode() - should return a value that is as unique to the object as you can. Try to come up with a hashCode result that isn't the same for all objects of the type but remember that if two objects are equal (as defined by equals above) then they MUST have the same hashCode value.

As writing a class, modify the test program to test each method as we have discussed in class. Test each method as you write it, as we have discussed in class.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Design a class named simpletrack
Reference No:- TGS03261607

Expected delivery within 24 Hours