EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

Oracle 1Z0-829 Exam Questions
Total Questions: 660
Java SE 17 Developer
Updated On: Jun 05, 2022
Page : 1-66
Question 1

Question ID: UK8297700
Consider below code of Test.java file:
package com.examtest.ocp;
 
class Parent {
    int i = 10;
    Parent(int i) {
        super();
        this.i = i;
    }
}
 
class Child extends Parent {
    int j = 20;
    
    Child(int j) {
        super(0);
        this.j = j;
    }
    
    Child(int i, int j) {
        super(i);
        this(j);
    }
    
}
 
public class Test {
    public static void main(String[] args) {
        Child child = new Child(1000, 2000);
        System.out.println(child.i + ":" + child.j);
    }
}
What is the result?

Options :
Answer: C

Question 2

Question ID: UK8298141
Consider below 3 statements:
1. System.out.println(700 * Math.pow(2, -2));
2. System.out.println(700 * (1 / 4));
3. System.out.println(7 * Math.ceil(24.80));
Do all the three statements produce same output?

Options :
Answer: B

Question 3

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?

Options :
Answer: B

Question 4

Question ID: UK8297797
Given code:
package com.examtest.ocp;
 
import java.util.ArrayList;
import java.util.List;
 
public class Test {
    public static void main(String[] args) {
       var list = new ArrayList<String>(); //Line n1
       list.add("A");
       list.add("M");
       var list_of_list = List.of(list); //Line n2
       list_of_list.get(0).set(1, "N"); //Line n3
       list_of_list.get(0).forEach(System.out::print); //Line n4
    }
}
What is the result?

Options :
Answer: D

Question 5

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.

Options :
Answer: A,D

© Copyrights Oracledumps 2026. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (Oracledumps). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the Oracledumps.