EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

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

Question ID: UK8293374
Which of the following are Java Exception classes?
Choose 3 options.

Options :
Answer: A,C,D

Question 2

Question ID: UK8291153
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
class Person {
    private String name;
    private int age;
    
    Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    
    public String toString() {
        return "Person[" + name + ", " + age + "]";
    }
    
    public boolean equals(Person obj) {
        if(obj instanceof Person) {
            Person person = (Person)obj;
            if(this.name.equals(person.name) && this.age == person.age) {
                return true;
            }
        }
        return false;
    }
}
 
public class Test {
    public static void main(String[] args) {
        List<Person> persons = new ArrayList<>();
        persons.add(new Person("Liam", 25));
        persons.add(new Person("Liam", 27));
        persons.add(new Person("Liam", 25));
        persons.add(new Person("Liam", 25));
        
        persons.remove(new Person("Liam", 25));
        
        for(Person person : persons) {
            System.out.println(person);
        }
    }
}
What is the result?

Options :
Answer: D

Question 3

Skipped
Question ID: UK8295920
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        int x = 4;
        switch (x) {
            default -> System.out.println("Unknown");
            case 1 -> System.out.println("x is equal to 1");
            case 2 -> System.out.println("x is equal to 2");
            case 3 -> System.out.println("x is equal to 3");
        }
    }
}
What is the result?

Options :
Answer: B

Question 4

Question ID: UK8292454
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    private static void div(int i, int j) {
        try {
            System.out.println(i / j);
        } catch(ArithmeticException e) {
            throw (RuntimeException)e;
        }
    }
    
    public static void main(String[] args) {
        try {
            div(5, 0);
        } catch(ArithmeticException e) {
            System.out.println("AE");
        } catch(RuntimeException e) {
            System.out.println("RE");
        }
    }
}
What is the result?

Options :
Answer: C

Question 5

Question ID: UK8292860
Given code of Test.java file:
package com.examtest.ocp;
 
class Car {
    void speed(Byteval) { //Line n1
        System.out.println("DARK"); //Line n2
    } //Line n3
 
    void speed(byte... vals) {
        System.out.println("LIGHT");
    }
}
 
public class Test {
    public static void main(String[] args) {
        byte b = 10; //Line n4
        new Car().speed(b); //Line n5
    }
}
Which of the following needs to be done so that LIGHT is printed on to the console?

Options :
Answer: B

© 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.