EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

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

Question ID: UK8298581
Given the code fragment:
String txt = "an";
System.out.println(txt.split("an").length);
What is the result?

Options :
Answer: A

Question 2

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 3

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 4

Question ID: UK8295123
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) {
        List<Character> list = new ArrayList<>();
        list.add(0, 'E');
        list.add('X');
        list.add(1, 'P');
        list.add(3, 'O');
        
        if(list.contains('O')) {
            list.remove('O');
        }
        
        for(char ch : list) {
            System.out.print(ch);
        }
    }
}
What is the result?

Options :
Answer: B

Question 5

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

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