EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

Oracle 1Z0-829 Exam Questions
Total Questions: 660
Java SE 17 Developer
Updated On: Nov 11, 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: UK8294682
Consider below codes of 3 java files:
//Shrinkable.java
package com.examtest.ocp;
 
public interface Shrinkable {
    public static void shrinkPercentage() {
        System.out.println("80%");
    }
}
//AntMan.java
package com.examtest.ocp;
 
public class AntMan implements Shrinkable { }


//Test.java
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        AntMan.shrinkPercentage();
    }
}
Which of the following statements is correct?

Options :
Answer: C

Question 3

Question ID: UK8294673
Consider below code of Test.java file:
package com.examtest.ocp;
 
abstract class Log {
    abstract long count(); //Line n1
    abstract Object get(); //Line n2
}
 
class CommunicationLog extends Log {
    int count() { //Line n3
        return 100;
    }
    
    String get() { //Line n4
        return "COM-LOG";
    }
}
 
public class Test {
    public static void main(String[] args) {
        Log log = new CommunicationLog(); //Line n5
        System.out.print(log.count());
        System.out.print(log.get());
    }
}
Which of the following statement is correct?

Options :
Answer: A

Question 4

Question ID: UK8296889
Given code of Test.java file:
package com.examtest.ocp;
 
class GrandParent {}
 
class Parent extends GrandParent {}
 
class Child extends Parent {}
 
class GrandChild extends Child {}
 
public class Test {
    public static void main(String... args) {
        GrandParent obj = new Child();
        if(!(obj instanceof GrandChild gc)) {
            System.out.print("Not a GrandChild");
            /*INSERT-1*/
        } 
        /*INSERT-2*/
        System.out.println(gc); //Line n2
    }
}
And the statements:
1. Above code causes compilation error
2. Above code compiles successfully and prints: Not a GrandChild
3. To resolve compilation error, replace /*INSERT-1*/ with return;
4. To resolve compilation error, replace /*INSERT-2*/ with else
How many of the above statements is/are correct?

Options :
Answer: C

Question 5

Question ID: UK8296388
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        final var str = "+";
        System.out.println(str.repeat(2) == "++");
    }
}
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.