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

Question 2

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 3

Question ID: UK8291585
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        var i = 1;
        var j = 5;
        var k = 0;
        A: while(true) {
            i++;
            B: while(true) {
                j--;
                C: while(true) {
                    k += i + j;
                    if(i == j)
                        break A;
                    else if (i > j)
                        continue A;
                    else 
                        continue B;
                }
            }
        }
        System.out.println(k);
    }
}
What is the result?

Options :
Answer: A

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: UK8297735
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    enum TrafficLight {
        private String message;
        GREEN("go"), AMBER("slow"), RED("stop");
        
        TrafficLight(String message) {
            this.message = message;
        }
        
        public String getMessage() {
            return message;
        }
    }
    
    public static void main(String[] args) {
        System.out.println(TrafficLight.AMBER.getMessage().toUpperCase());
    }
What is the result?

Options :
Answer: C

© 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.