Consider below codes of 3 java files:
1. //Super.java
2. package com.sampleproject.oca;
3.
4. public interface Super {
5. String name = "SUPER"; //Line n1
6. }
1. //Sub.java
2. package com.sampleproject.oca;
3.
4. public interface Sub extends Super { //Line n2
5.
6. }
1. //Test.java
2. package com.sampleproject.oca;
3.
4. public class Test {
5. public static void main(String[] args) {
6. Sub sub = null;
7. System.out.println(sub.name); //Line n3
8. }
9.
Which of the following statements is correct?
Given:

What will be the result of compiling and executing Test class?
package com.udayan.oca;
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String[] args) {
List
list.add(100);
list.add(7);
list.add(50);
list.add(17);
list.add(10);
list.add(5);
list.removeIf(a -> a % 10 == 0);
System.out.println(list);
}
}
Given code of Thought.java file:
1. public class Thought {
2. /*INSERT*/ {
3. System.out.println("All is well");
4. }
5. }
Which 3 options, if used to replace /*INSERT*/, will compile successfully and on execution will print "All is well" on to the console?
CGiven the code fragments:

© Copyrights Oracledumps 2026. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.