Q45.webp
vanhoa2005

Q45.webp

Question: 45
(Choose 1 answer)
What will be the output of the following code?
A. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
B. arr[10]=10
Finished!
C. Khối lệnh finally
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
D. arr[10] 10
Khối lệnh finally
Finished!
public class Ex1 {
public static void main(String[] args) {
try {
int intArr[] = new int[10];
intArr [10] = 10;
"
System.out.println("arr[10] = + intArr [9]);
} catch (NullPointerException ex) {
} finally {
System.out.println(ex);
System.out.println("Finally statement");
}
}
}
System.out.println("Finished!");

Thông tin

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

Share this media

Back
Bên trên Bottom