PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
successful_man

PRO192_-_SU_2023_-_Block_5_-_FE_735.webp

(16)
Answer (Choose 1 answer)
A. The program will print out: 17
B. The program will print out: 19
C. The program has a compile error.
D. The program will print out: 21
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(5);
t.add(2);
Iterator<Integer> i = t.iterator();
int sum=0;
while(i.hasNext()) sum += i.next();
System.out.println(sum);

Thông tin

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

Image metadata

Filename
PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
File size
53.9 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom