PRO192_-_SP_2024_-_RE_1741.webp
Izumi991

PRO192_-_SP_2024_-_RE_1741.webp

  • Media owner Izumi991
  • Ngày thêm
(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.


Q: 45

Thông tin

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

Image metadata

Filename
PRO192_-_SP_2024_-_RE_1741.webp
File size
210.2 KB
Dimensions
1920px x 892px

Share this media

Back
Bên trên Bottom