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 24, 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

Question ID: UK8297789
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) {
        Boolean [] arr = new Boolean[2];
        List<Boolean> list = new ArrayList<>();
        list.add(arr[0]);
        list.add(arr[1]);
        
        if(list.remove(0)) {
            list.remove(1);
        }
        
        System.out.println(list);
    }
}
What is the result?


Answer: C
Question 3

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
Question 4

Question ID: UK8295901
Consider below code:
package com.examtest.ocp;
 
public class Test {
    static Double d1;
    static int x = d1.intValue();
    
    public static void main(String[] args) {
        System.out.println("HELLO");
    }
}
On execution, does Test class print HELLO on to the console?


Answer: B
Question 5

Question ID: UK8296802
Given code:
package com.examtest.ocp;
 
class A {
    A() {
        System.out.print(1);
    }
    class B {
        B() {
            System.out.print(2);
        }
    }
}
 
public class Test {
    public static void main(String [] args) {
        B obj = new A().new B();
    }
}
What is the result?


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