EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

Oracle 1Z0-829 Exam Questions
Total Questions: 660
Java SE 17 Developer
Updated On: Oct 08, 2025
Page : 1-66
Question 1

Question ID: UK8297722
Given code of Test.java file:
package com.examtest.ocp;
 
interface Rideable {
    void ride(String name);
}
 
class Animal {}
 
class Horse extends Animal implements Rideable {
    public void ride(String name) {
        System.out.println(name.toUpperCase() + " IS RIDING THE HORSE");
    }
}
 
public class Test {
    public static void main(String[] args) {
        Animal horse = new Horse();
        /*INSERT*/
    }
}
Which of the following options, if used to replace /*INSERT*/, will compile successfully and on execution will print EMMA IS RIDING THE HORSE on to the console?
Choose 4 options.

Options :
Answer: A,C

Question 2

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?

Options :
Answer: A

Question 3

Question ID: UK8292097
Below is the code of Test.java file:
package com.examtest.ocp;
 
import java.util.*;
 
public class Test {
    public static void main(String[] args) {
        var list = new ArrayList<>(); //Line n1
        list.add("TAKE");
        list.add("THE");
        list.add("RISK");
 
        System.out.println(String.join(".", list)); //Line n2
    }
}
What is the result?

Options :
Answer: B

Question 4

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?

Options :
Answer: A

Question 5

Question ID: UK8298570
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test extends String {
    @Override
    public String toString() {
        return "TEST";
    }
    
    public static void main(String[] args) {
        Test obj = new Test();
        System.out.println(obj);
    }
}
What is the result?

Options :
Answer: D

© Copyrights Oracledumps 2025. 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.