EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

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

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 2

Question ID: UK8291167
Given code:
package com.examtest.ocp;
 
interface Message {
    String msg = "CONSISTENCY";
    public default void quoteOfTheDay() {
        record Quote(){ //Line n1
            String combine(String str) {
                return msg + "=" + str; //Line n2
            }
        }
        System.out.println(new Quote().combine("SUCCESS")); //Line n3
    }
}
 
public class Test {
    public static void main(String[] args) {
        new Message(){}.quoteOfTheDay(); //Line n4
    }
}
What is the result?

Options :
Answer: A

Question 3

Question ID: UK8291180
Given code of Test.java file:
package com.examtest.ocp;
 
sealed abstract class Animal permits Cat, Dog { } //Line n1
 
non-sealed class Cat extends Animal { } //Line n2
 
final class Dog extends Animal { } //Line n3
 
final class Tiger extends Animal { } //Line n4
 
public class Test {
    public static void main(String [] args) {
        System.out.println("PERMITS CLAUSE");
    }
}
What is the result?

Options :
Answer: A

Question 4

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

Options :
Answer: C

Question 5

Question ID: UK8295941
Given code of TestStudent.java file:
package com.examtest.ocp;
 
class Student {
    String name;
    int age;
    boolean result;
    double height;
}
 
public class TestStudent {
    public static void main(String[] args) {
        var stud = new Student(); //Line n1
        System.out.println(stud.name + stud.height + stud.result + stud.age); //Line n2
    }
}
What is the result?

Options :
Answer: A

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