Exception in thread "main" java.lang.ClassCastException: Apple cannot be cast to java.lang.Comparable at java.util.TreeMap.put(TreeMap.java:542) at java.util.TreeSet.add(TreeSet.java:238) at MainClass.main(MainClass.java:8)
A. The Apple class doesn't implement Comparable.