Free Oracle 1Z0-829 Exam Questions

Become Oracle Certified with updated 1Z0-829 exam questions and correct answers

Page:    1 / 132      
Total 660 Questions | Updated On: Nov 12, 2025
Add To Cart
Question 1

Given the course table:



Given the code fragment:


 


Answer: C
Question 2

Given code of Test.java file:
package com.examtest.ocp;

public class Test {
    private static String print(String... args) {
        return String.join("-", args); //Line n1
    }
    
    private static Object print(Object... args) {
        String str = "";
        for(Object obj : args) {
            if(obj instanceof String) { //Line n2
                str += (String) obj; //Line n3
            }
        }
        return str; //Line n4
    }
    
    public static void main(String... args) {
        Object obj1 = new String("SPORT"); //Line n5
        Object obj2 = new String("MAD"); //Line n6
        System.out.println(print(obj1, obj2)); //Line n7
    }
}
What is the result?


Answer: A
Question 3

Question ID: UK8292478
Given code of Test.java file:
package com.examtest.ocp;
 
import java.util.Arrays;
 
public class Test {
    public static void main(String[] args) {
        int [] array1 = {};
        int [] array2 = {100, 200};
        System.out.print(Arrays.compare(array1, array2));
        System.out.print(Arrays.mismatch(array1, array2));
    }
}
What is the result?


Answer: A
Question 4

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?


Answer: D
Question 5

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?


Answer: A
Page:    1 / 132      
Total 660 Questions | Updated On: Nov 12, 2025
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.