(Choose 1 answer)
What happens when you try to compile and run this application?
1. import java.util.*;
2.
3. public class Apple {
4.public static void main(String[] a) {
5.Set<Apple> set = new TreeSet<Apple>();
67
7.
set.add(new Apple());set.add(new Apple());
8.set.add(new Apple());
9. } 10.}
A. Compiler error.
B. An exception is thrown at line 6 (Apple cannot be cast to java.lang.Comparable).
C. An exception is thrown at line 7 (Apple cannot be cast to java.lang.Comparable)...
D. An exception is thrown at line 8 (Apple cannot be cast to java.lang.Comparable)..
E. No exception is thrown.
Exit 49