KB book
pg-573
Collections and Array
Putting it all together, our DVDInfo class should now look like this:
Now, when we invoke Collections.sort(dvdList); we get
[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
]
how does the call to Collections.sort(dvdList); sort the elements of DVDInfo ?
we are passing the whole dvdlist to sort method.
now how would it call compareTo method and that also with DVDINFO object