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: UK8292860
Given code of Test.java file:
package com.examtest.ocp;
 
class Car {
    void speed(Byteval) { //Line n1
        System.out.println("DARK"); //Line n2
    } //Line n3
 
    void speed(byte... vals) {
        System.out.println("LIGHT");
    }
}
 
public class Test {
    public static void main(String[] args) {
        byte b = 10; //Line n4
        new Car().speed(b); //Line n5
    }
}
Which of the following needs to be done so that LIGHT is printed on to the console?


Answer: B
Question 2

Question ID: UK8291513
Given code of Test.java file:
package com.examtest.ocp;
 
import java.time.LocalDate;
 
public class Test {
    public static void main(String [] args) {
        LocalDate date = LocalDate.ofEpochDay(1);
        System.out.println(date);
    }
}
What is the result?


Answer: B
Question 3

Given the directory structure:




Given the definition of the Doc class:




Which two are valid definition of the wordDoc class?



Answer: A,E
Question 4

Question ID: UK8291180
Given code of Test.java file:
package com.examtest.ocp;
 
sealed abstract class Animal permits Cat, Dog { } //Line n1
 
non-sealed class Cat extends Animal { } //Line n2
 
final class Dog extends Animal { } //Line n3
 
final class Tiger extends Animal { } //Line n4
 
public class Test {
    public static void main(String [] args) {
        System.out.println("PERMITS CLAUSE");
    }
}
What is the result?


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