Author | Message |
---|---|
dvictor4
Posts: 34
|
Posted 14:34 Sep 05, 2017 |
Hello I am having trouble understanding the highlighted bullet point: The Sorting Class:
Does this mean that the generic sort method should only accept a SimpleSet of elements that are comparable OR does this mean that you should only be able to create a SimpleSet of elements that are comparable? |
kknaur
Posts: 540
|
Posted 16:14 Sep 05, 2017 |
Yes the generic Sort should ONLY allow things that are Comparable. So if the SimpleSet has Comparable items it will work with the method. The SimpleSet itself can have noncomparable things, but if you were to try to sort them the method invocation would fail with a compile error. Last edited by kknaur at
16:15 Sep 05, 2017.
|
dvictor4
Posts: 34
|
Posted 16:27 Sep 05, 2017 |
Got it thanks! |