EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

Oracle 1Z0-829 Exam Questions
Total Questions: 660
Java SE 17 Developer
Updated On: Dec 07, 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: UK8292860
Given code of Test.java file:
package com.examtest.ocp;
 
class Car {
    void speed(Byteval) { //Line n1
        System.out.println("DARK"); //Line n2
    } //Line n3
 
    void speed(byte... vals) {
        System.out.println("LIGHT");
    }
}
 
public class Test {
    public static void main(String[] args) {
        byte b = 10; //Line n4
        new Car().speed(b); //Line n5
    }
}
Which of the following needs to be done so that LIGHT is printed on to the console?

Options :
Answer: B

Question 4

Question ID: UK8297291
Consider below code snippet:
var x = Double.valueOf(Math.random() * 10).intValue();
System.out.println(x);
Which of the following statements is correct?

Options :
Answer: D

Question 5

Given code of Test.java file:
package com.examtest.ocp;

public class Test {
    private static String print(String... args) {
        return String.join("-", args); //Line n1
    }
    
    private static Object print(Object... args) {
        String str = "";
        for(Object obj : args) {
            if(obj instanceof String) { //Line n2
                str += (String) obj; //Line n3
            }
        }
        return str; //Line n4
    }
    
    public static void main(String... args) {
        Object obj1 = new String("SPORT"); //Line n5
        Object obj2 = new String("MAD"); //Line n6
        System.out.println(print(obj1, obj2)); //Line n7
    }
}
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.