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: 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 2

Question ID: UK8298155
Following statement in a Java program compiles successfully:
student.report(course);
What can you say for sure?

Options :
Answer: C

Question 3

Question ID: UK8295913
Given code of Test.java file:
package com.examtest.ocp;
 
record Rectangle(double length, double width) {}
 
record Square(double side) extends Rectangle {}
 
public class Test {
    public static void main(String[] args) {
        Square sq = new Square(10.0);
        System.out.println(sq);
    }
}
What is the result?

Options :
Answer: A

Question 4

Question ID: UK8291549
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    private static void m(int i) {
        System.out.print(1);
    }
    
    private static void m(int i1, int i2) {
        System.out.print(2);
    }
    
    private static void m(char... args) {
        System.out.print(3);
    }
   
    public static void main(String... args) {
        m('A');
        m('A', 'B');
        m('A', 'B', 'C');
        m('A', 'B', 'C', 'D');
    }
}
What is the result?

Options :
Answer: C

Question 5

Question ID: UK8292410
Consider below code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        Boolean b = Boolean.valueOf("tRUe");
        switch(b) {
            case true:
                System.out.println("ONE");
            case false:
                System.out.println("TWO");
            default: 
                System.out.println("THREE");
        }
    }
}
What is the result of compiling and executing Test class?

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.