This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Below is code I created based on Sierra/Bates Chapter 7. It compiles and runs; I have a related question. See below.
This following is output:
[2001 sci-fi ??
, Caddy Shack comedy Murray, Bill
, Donnie Darko sci-fi Gyllenhall, Jake
, Lost in Translation comedy Murray, Bill
, Patriot Games action Ford, Harrison
, Raiders of the Lost Ark action Ford, Harrison
, Star Wars sci-fi Ford, Harrison
Is there another way this code can compare dvdList without having DVDInfo extend Comparable? Sierra/Bates mentions:
Returning to our earlier example for class DVDInfo, we can take the easy way out and use the String class’s implementation of compareTo():
Please clarify what is the un-easy way to compare dvdList?