G

GIAC Secure Software Programmer – Java

273 Questions

You can start the exam to practice all questions related to this exam.

Question No. 1

Dennis works as a Programmer in Broadnet Inc. He writes the following program.
1. public class Ques0307{
2. public static void main(String[] argv){
3. int arr[] = {1, 2, 3, 4};
4. try{
5. int k = 0;
6. for(; k < 4; k++)
7. arr[k] = arr[k] + 1;
8. System.out.println("try");
9. }
10. catch(ArrayIndexOutOfBoundsException a){
11. System.out.println("index " +k +" not found");
12. }
13. catch(Exception e){
14. System.out.println("catch1");
15. }
16. finally{
17. System.out.println("finally");
18. }
19. }
20. }
What will happen when Dennis attempts to compile and execute the program?
 

Choose the correct option from the given list.
01 / 273

0 Discussions

Trending Exams