But since TreeSet is a sorted collection, which means, what inserted in it should be Comparable, line 4 will cause a runtime exception because Foo is not Comparable.
|
Oracle Certified Professional Java Programmer
Author:
JavaChamp TeamSenior Java Developer
QuizOver.com
Germany
Access: |