EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

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

Question ID: UK8297735
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    enum TrafficLight {
        private String message;
        GREEN("go"), AMBER("slow"), RED("stop");
        
        TrafficLight(String message) {
            this.message = message;
        }
        
        public String getMessage() {
            return message;
        }
    }
    
    public static void main(String[] args) {
        System.out.println(TrafficLight.AMBER.getMessage().toUpperCase());
    }
What is the result?

Options :
Answer: C

Question 2

Question ID: UK8295123
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) {
        List<Character> list = new ArrayList<>();
        list.add(0, 'E');
        list.add('X');
        list.add(1, 'P');
        list.add(3, 'O');
        
        if(list.contains('O')) {
            list.remove('O');
        }
        
        for(char ch : list) {
            System.out.print(ch);
        }
    }
}
What is the result?

Options :
Answer: B

Question 3

Question ID: UK8295509
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        String arr1 [], arr2, arr3 = null; //Line n1
        arr1 = new String[2];
        arr1[0] = "A";
        arr1[1] = "B";
        arr2 = arr3 = arr1; //Line n2
        System.out.println(String.join("-", arr2)); //Line n3
    }
}
What is the result?

Options :
Answer: B

Question 4

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

Options :
Answer: A,C,D

Question 5

Question ID: UK8296869
Given code of Test.java file:
package com.examtest.ocp;
 
class Parent {
    int var = 1000; // Line n1
 
    int getVar() {
        return var;
    }
}
 
class Child extends Parent {
    private int var = 2000; // Line n2
 
    int getVar() {
        return super.var; //Line n3
    }
}
 
public class Test {
    public static void main(String[] args) {
        Child obj = new Child(); // Line n4
        System.out.println(obj.var); // Line n5
    }
}
There is a compilation error in the code.
Which three modifications, done independently, print 1000 on to the console?

Options :
Answer: A,B,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.