Question: In JAVA, Develop a superclass Music and subclasses Classic and Pop. You should implement the Comparable interface of Classic and Pop. Each Classic object contains
In JAVA, Develop a superclass Music and subclasses Classic and Pop. You should implement the Comparable interface of Classic and Pop. Each Classic object contains a title and a composer. Each Pop object contains a title and a integer ranking.
For testing, an array of Pop objects will be generated and sorted in alphabetic order of their composers. You should print out the order, title, and composer of these objects before and after the sorting.
An array of Pop objects will be generated and sorted by their rankings. You should print out the order, title, and ranking of these objects before and after the sorting.
For testing Classic, please use these inputs:
- Piano Concerto No. 24 in C minor, K. 491 by Wolfgang Mozart
- Revolutionary Etude (Op. 10, No. 12) by Frederic Chopin
- Swan Lake by Pyotr Ilyich Tchaikovsky
- Symphony No. 9 in D minor, Op. 125 by Ludwig van Beethoven
For testing Pop, please use these inputs:
- Supernatural, rank 36
- Thriller, rank 2
- Doctor Zhivago, rank 8
- Frozen, rank 17
- Fearless, rank 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
