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: UK8298570
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test extends String {
    @Override
    public String toString() {
        return "TEST";
    }
    
    public static void main(String[] args) {
        Test obj = new Test();
        System.out.println(obj);
    }
}
What is the result?


Answer: D
Question 2

Question ID: UK8297291
Consider below code snippet:
var x = Double.valueOf(Math.random() * 10).intValue();
System.out.println(x);
Which of the following statements is correct?


Answer: D
Question 3

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

Question ID: UK8298565
Consider below code of Test.java file:
package com.examtest.ocp; 
 
public class Test {
    public static void main(String[] args) {
        String str = "*";
        /*INSERT*/
        System.out.println(str);
    }
}
Which of the following options, if used to replace /*INSERT*/, will compile successfully and on execution will print ***** on to the console?
Choose 2 options.


Answer: A,B
Question 5

Question ID: UK8291953
Consider below code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String [] args) {
        var text = """
            I gave him $200 and \
            he returned me €120, \
            so I am left with £80.""";
 
        System.out.println(
            text.transform(Test::removeCurrencySymbols)
                .transform(String::toUpperCase)
                .formatted("¥", "¥", "¥"));
    }
 
    private static String removeCurrencySymbols(String s) {
        return s.replaceAll("\\$", "%s")
                .replaceAll("€", "%s")
                .replaceAll("£", "%s");
    }
}
What is the result?


Answer: B
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.