EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

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

Question ID: UK8296377
Daylight saving time of 2018 in United States (US) ended at 4-Nov-2018 2:00 AM.
What will be the result of compiling and executing below code?
package com.examtest.ocp;
 
import java.time.*;
 
public class Test {
    public static void main(String [] args) {
        LocalDate date = LocalDate.of(2018, 11, 4);
        LocalTime time = LocalTime.of(13, 59, 59);
        ZonedDateTime dt = ZonedDateTime.of(date, time, ZoneId.of("America/New_York"));
        dt = dt.plusSeconds(1);
        System.out.println(dt.getHour() + ":" + dt.getMinute() + ":" + dt.getSecond());
    }
}

Options :
Answer: C

Question 2

Question ID: UK8297789
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
public class Test {
    public static void main(String[] args) {
        Boolean [] arr = new Boolean[2];
        List<Boolean> list = new ArrayList<>();
        list.add(arr[0]);
        list.add(arr[1]);
        
        if(list.remove(0)) {
            list.remove(1);
        }
        
        System.out.println(list);
    }
}
What is the result?

Options :
Answer: C

Question 3

Question ID: UK8294673
Consider below code of Test.java file:
package com.examtest.ocp;
 
abstract class Log {
    abstract long count(); //Line n1
    abstract Object get(); //Line n2
}
 
class CommunicationLog extends Log {
    int count() { //Line n3
        return 100;
    }
    
    String get() { //Line n4
        return "COM-LOG";
    }
}
 
public class Test {
    public static void main(String[] args) {
        Log log = new CommunicationLog(); //Line n5
        System.out.print(log.count());
        System.out.print(log.get());
    }
}
Which of the following statement is correct?

Options :
Answer: A

Question 4

Question ID: UK8293794
Given code of Test.java file:
package com.examtest.ocp;
 
class MyException extends RuntimeException {}
 
class YourException extends RuntimeException {}
 
public class Test {
    public static void main(String[] args) {
        try {
            throw new YourException();
        } catch(MyException | YourException e){
            e = null;
        }
    }
}
What is the result?

Options :
Answer: A

Question 5

Question ID: UK8291180
Given code of Test.java file:
package com.examtest.ocp;
 
sealed abstract class Animal permits Cat, Dog { } //Line n1
 
non-sealed class Cat extends Animal { } //Line n2
 
final class Dog extends Animal { } //Line n3
 
final class Tiger extends Animal { } //Line n4
 
public class Test {
    public static void main(String [] args) {
        System.out.println("PERMITS CLAUSE");
    }
}
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.