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: UK8292486
Given code of Test.java file
package com.examtest.ocp;
public class Test {
    public static < T > T get(T t) {
        return t;
    }
    public static void main(String[] args) {
        String str = get("HELLO");
        System.out.println(str);
    }
}
What is the result?

Options :
Answer: A

Question 2

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?

Options :
Answer: C

Question 3

Question ID: UK8295506
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        String[] arr = { "L", "I", "V", "E" }; //Line n1
        int i = -2;
 
        if (i++ == -1) { //Line n2
            arr[-(--i)] = "F"; //Line n3
        } else if (--i == -2) { //Line n4
            arr[-++i] = "O"; //Line n5
        }
 
        System.out.println(String.join("", arr)); //Line n6
    }
}
What is the result?

Options :
Answer: A

Question 4

Question ID: UK8298565
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        String str = "*";
        /*INSERT*/
        System.out.println(str);
    }
}
Which of the following options, if used to replace /*INSERT*/, will compile successfully and on execution will print ***** on to the console?
Choose 2 options.

Options :
Answer: A,B

Question 5

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

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