Free Oracle 1Z0-829 Exam Questions

Become Oracle Certified with updated 1Z0-829 exam questions and correct answers

Page:    1 / 132      
Total 660 Questions | Updated On: Sep 11, 2025
Add To Cart
Question 1

Question ID: UK8297789
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
public class Test {
    public static void main(String[] args) {
        Boolean [] arr = new Boolean[2];
        List<Boolean> list = new ArrayList<>();
        list.add(arr[0]);
        list.add(arr[1]);
        
        if(list.remove(0)) {
            list.remove(1);
        }
        
        System.out.println(list);
    }
}
What is the result?


Answer: C
Question 2

Question ID: UK8294682
Consider below codes of 3 java files:
//Shrinkable.java
package com.examtest.ocp;
 
public interface Shrinkable {
    public static void shrinkPercentage() {
        System.out.println("80%");
    }
}
//AntMan.java
package com.examtest.ocp;
 
public class AntMan implements Shrinkable { }


//Test.java
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        AntMan.shrinkPercentage();
    }
}
Which of the following statements is correct?


Answer: C
Question 3

Question ID: UK8294624
Given code:
package com.examtest.ocp;
 
class Outer {
    private String msg = "A";
    public void print() {
        final String msg = "B";
        class Inner {
            public void print() {
                System.out.println(this.msg);
            }
        }
        Inner obj = new Inner();
        obj.print();
    }
}
 
public class Test {
    public static void main(String[] args) {
        new Outer().print(); 
    }
}
What is the result?


Answer: A
Question 4

Question ID: UK8291577
Given code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        for:
        for (int i = 2; i <= 100; i = i + 2) {
            for(int j = 1; j <= 10; j++) {
                System.out.print(i * j + "\t");
            }
            System.out.println();
            if(i == 10) {
                break for;
            }
        }
    }
}
What is the result?


Answer: A
Question 5

Question ID: UK8293794
Given code of Test.java file:
package com.examtest.ocp;
 
class MyException extends RuntimeException {}
 
class YourException extends RuntimeException {}
 
public class Test {
    public static void main(String[] args) {
        try {
            throw new YourException();
        } catch(MyException | YourException e){
            e = null;
        }
    }
}
What is the result?


Answer: A
Page:    1 / 132      
Total 660 Questions | Updated On: Sep 11, 2025
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.