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: UK8298194
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        short [] args = new short[]{50, 50};
        args[0] = 5;
        args[1] = 10;
        System.out.println("[" + args[0] + ", " + args[1] + "]");
    }
}
What is the result?

Options :
Answer: A

Question 2

Question ID: UK8295506
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        String[] arr = { "L", "I", "V", "E" }; //Line n1
        int i = -2;
 
        if (i++ == -1) { //Line n2
            arr[-(--i)] = "F"; //Line n3
        } else if (--i == -2) { //Line n4
            arr[-++i] = "O"; //Line n5
        }
 
        System.out.println(String.join("", arr)); //Line n6
    }
}
What is the result?

Options :
Answer: A

Question 3

Question ID: UK8291153
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
class Person {
    private String name;
    private int age;
    
    Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    
    public String toString() {
        return "Person[" + name + ", " + age + "]";
    }
    
    public boolean equals(Person obj) {
        if(obj instanceof Person) {
            Person person = (Person)obj;
            if(this.name.equals(person.name) && this.age == person.age) {
                return true;
            }
        }
        return false;
    }
}
 
public class Test {
    public static void main(String[] args) {
        List<Person> persons = new ArrayList<>();
        persons.add(new Person("Liam", 25));
        persons.add(new Person("Liam", 27));
        persons.add(new Person("Liam", 25));
        persons.add(new Person("Liam", 25));
        
        persons.remove(new Person("Liam", 25));
        
        for(Person person : persons) {
            System.out.println(person);
        }
    }
}
What is the result?

Options :
Answer: D

Question 4

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 5

Question ID: UK8296388
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        final var str = "+";
        System.out.println(str.repeat(2) == "++");
    }
}
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.