Stay ahead with 100% Free Java SE 8 Programmer I 1Z0-808 Dumps Practice Questions
Given the code fragment:
Given the code fragment:
What will be the result of compiling and executing Test class?
1. package com.udayan.oca;
2.
3. import java.util.ArrayList;
4. import java.util.List;
5.
6. public class Test {
7. public static void main(String[] args) {
8. List
9. list.add(100);
10. list.add(200);
11. list.add(100);
12. list.add(200);
13. list.remove(new Integer(100));
14.
15. System.out.println(list);
16. }
17. }
Consider below code of Test.java file:
1. package com.sampleproject.oca;
2.
3. public class Test {
4. public static void main(String[] args) {
5. String [][] arr = { {"%", "$$"}, {"***", "@@@@", "#####"}};
6. for(String [] str : arr) {
7. for(String s : str) {
8. System.out.println(s);
9. if(s.length() == 4) //Line n1
10. break; //Line n2
11. }
12. break; //Line n3
13. }
14. }
15. }
What will be the result of compiling and executing Test class?
Which of the following is a checked Exception?
© Copyrights TheExamsLab 2025. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLab.