PRO192_-_REB5_-_FA_2023_1330.webp
lanhong87

PRO192_-_REB5_-_FA_2023_1330.webp

(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

Thông tin

Category
PRO192
Thêm bởi
lanhong87
Ngày thêm
Lượt xem
4,555
Lượt bình luận
29
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_REB5_-_FA_2023_1330.webp
File size
60.5 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom