EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

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

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 2

Question ID: UK8291525
Below is the code of TestSellable.java file:
package com.examtest.ocp;
 
interface Sellable {
    double getPrice();
}
 
public class TestSellable {
    private static void printPrice(Sellable sellable) {
        System.out.println(sellable.getPrice());
    }
 
    public static void main(String[] args) {
        /*INSERT*/
    }
}
Which of the following options can replace /*INSERT*/ such that there are no compilation errors?
Choose 3 options.

Options :
Answer: A,D

Question 3

Question ID: UK8298141
Consider below 3 statements:
1. System.out.println(700 * Math.pow(2, -2));
2. System.out.println(700 * (1 / 4));
3. System.out.println(7 * Math.ceil(24.80));
Do all the three statements produce same output?

Options :
Answer: B

Question 4

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 5

Question ID: UK8291982
Consider below code of Test.java file:
package com.examtest.ocp;
 
import java.time.LocalDate;
 
class MyLocalDate extends LocalDate {
    @Override
    public String toString() {
        return super.getDayOfMonth() + "-" + super.getMonthValue() + "-" +  super.getYear();
    }
}
 
public class Test {
    public static void main(String [] args) {
        MyLocalDate date = LocalDate.parse("1980-03-16");
        System.out.println(date);
    }
}
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.