PRO192_-_C1_-_FE_-_SU_2023_391.webp
H

PRO192_-_C1_-_FE_-_SU_2023_391.webp

(Choose 1 answer)
What happens when you try to compile and run the following program?
import java.util.*;
public class Main{
public static void main(String argv[]){
TreeSet<Integer> t = new TreeSet<Integer>();
t.add(12);
t.add(2);
t.add(4);
t.add(2);
Iterator<Integer> i = t.iterator();
int sum=0;
while(i.hasNext()) sum += i.next();
System.out.println(sum);
A. The program will print out: 18
B. The program will print out: 20
C. The program will print out: 16
D. The program has a compile error.
Edt (27)

Thông tin

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

Image metadata

Filename
PRO192_-_C1_-_FE_-_SU_2023_391.webp
File size
65.6 KB
Dimensions
1713px x 893px

Share this media

Back
Bên trên Bottom