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

Question 2

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

Question 3

Question ID: UK8292097
Below is the code of Test.java file:
package com.examtest.ocp;
 
import java.util.*;
 
public class Test {
    public static void main(String[] args) {
        var list = new ArrayList<>(); //Line n1
        list.add("TAKE");
        list.add("THE");
        list.add("RISK");
 
        System.out.println(String.join(".", list)); //Line n2
    }
}
What is the result?

Options :
Answer: B

Question 4

Question ID: UK8291953
Consider below code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String [] args) {
        var text = """
            I gave him $200 and \
            he returned me €120, \
            so I am left with £80.""";
 
        System.out.println(
            text.transform(Test::removeCurrencySymbols)
                .transform(String::toUpperCase)
                .formatted("¥", "¥", "¥"));
    }
 
    private static String removeCurrencySymbols(String s) {
        return s.replaceAll("\\$", "%s")
                .replaceAll("€", "%s")
                .replaceAll("£", "%s");
    }
}
What is the result?

Options :
Answer: B

Question 5

Question ID: UK8291513
Given code of Test.java file:
package com.examtest.ocp;
 
import java.time.LocalDate;
 
public class Test {
    public static void main(String [] args) {
        LocalDate date = LocalDate.ofEpochDay(1);
        System.out.println(date);
    }
}
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.