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: Dec 06, 2025
Add To Cart
Question 1

Question ID: UK8297722
Given code of Test.java file:
package com.examtest.ocp;
 
interface Rideable {
    void ride(String name);
}
 
class Animal {}
 
class Horse extends Animal implements Rideable {
    public void ride(String name) {
        System.out.println(name.toUpperCase() + " IS RIDING THE HORSE");
    }
}
 
public class Test {
    public static void main(String[] args) {
        Animal horse = new Horse();
        /*INSERT*/
    }
}
Which of the following options, if used to replace /*INSERT*/, will compile successfully and on execution will print EMMA IS RIDING THE HORSE on to the console?
Choose 4 options.


Answer: A,C
Question 2

Question ID: UK8292809
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        System.out.println(add(90, 7));
        System.out.println(add('a', 1)); //ASCII code for 'a' is 97 and 'b' is 98
    }
    
    public static var add(int v1, int v2) {
        return v1 + v2;
    }
}
What is the result?


Answer: A
Question 3

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 4

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?


Answer: B
Question 5

Question ID: UK8291961
Consider below statements:
1. int x = 5____0;
2. int y = ____50;
3. int z = 50____;
4. float f = 123.76_86f;
5. double d = 1_2_3_4;
How many statements are legal?


Answer: C
Page:    1 / 132      
Total 660 Questions | Updated On: Dec 06, 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.