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: UK8291921
Given code of Test.java file:
package com.examtest.ocp;
 
import java.time.*;
 
public class Test {
    public static void main(String [] args) {
        System.out.println(Duration.ofDays(-2));
    }
}
What is the result?

Options :
Answer: C

Question 2

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 3

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 4

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 5

Question ID: UK8294645
Given code of Test.java file:
package com.examtest.ocp;
 
import java.io.IOException;
import java.sql.SQLException;
 
class MyResource implements AutoCloseable {
    @Override
    public void close() throws IOException{
        throw new IOException("IOException");
    }
 
    public void execute() throws SQLException {
        throw new SQLException("SQLException");
    }
}
 
public class Test {
    public static void main(String[] args) {
        try(MyResource resource = new MyResource()) {
            resource.execute();
        } catch(Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
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.