PRO192_FE_SP23_311.webp
Soram

PRO192_FE_SP23_311.webp

  • Media owner Soram
  • Ngày thêm
Bài viết gốc: Chủ đề 'PRO192 FE SP23'
Answer (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[]){
Vector<Integer> t = new Vector<Integer>();
t.add(12);
t.add(2);
t.add(6);
t.add(2.4);
Iterator<Integer> i = t.iterator();
int sum=0;
while(i.hasNext()) sum += i.next();
System.out.println(sum);
}
}
A. The program will print out: 20
B. The program will print out: 22
C. The program will print out: 18
D. The program has a compile error.
Save at server failed!. Please inform the supervisor and continue the exam.

Thông tin

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

Share this media

Back
Bên trên Bottom