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

Question ID: UK8291525
Below is the code of TestSellable.java file:
package com.examtest.ocp;
 
interface Sellable {
    double getPrice();
}
 
public class TestSellable {
    private static void printPrice(Sellable sellable) {
        System.out.println(sellable.getPrice());
    }
 
    public static void main(String[] args) {
        /*INSERT*/
    }
}
Which of the following options can replace /*INSERT*/ such that there are no compilation errors?
Choose 3 options.


Answer: A,D
Question 2

Given:

Which two method invocation execute? 


Answer: D,E
Question 3

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 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?


Answer: A
Question 5

Question ID: UK8291577
Given code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        for:
        for (int i = 2; i <= 100; i = i + 2) {
            for(int j = 1; j <= 10; j++) {
                System.out.print(i * j + "\t");
            }
            System.out.println();
            if(i == 10) {
                break for;
            }
        }
    }
}
What is the result?


Answer: A
Page:    1 / 132      
Total 660 Questions | Updated On: Jun 23, 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.