EXPERTY DESIGNED 1Z0-829 PRACTICE TEST

Oracle 1Z0-829 Exam Questions
Total Questions: 660
Java SE 17 Developer
Updated On: Dec 07, 2025
Page : 1-66
Question 1

Question ID: UK8296394
Consider below code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    public static void main(String[] args) {
        var sb = new StringBuilder();
        System.out.println(sb.append("").append("").append("").length());
    }
}
What is the result?

Options :
Answer: A

Question 2

Question ID: UK8295123
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) {
        List<Character> list = new ArrayList<>();
        list.add(0, 'E');
        list.add('X');
        list.add(1, 'P');
        list.add(3, 'O');
        
        if(list.contains('O')) {
            list.remove('O');
        }
        
        for(char ch : list) {
            System.out.print(ch);
        }
    }
}
What is the result?

Options :
Answer: B

Question 3

Given:




What is the result?

Options :
Answer: E

Question 4

Question ID: UK8292454
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    private static void div(int i, int j) {
        try {
            System.out.println(i / j);
        } catch(ArithmeticException e) {
            throw (RuntimeException)e;
        }
    }
    
    public static void main(String[] args) {
        try {
            div(5, 0);
        } catch(ArithmeticException e) {
            System.out.println("AE");
        } catch(RuntimeException e) {
            System.out.println("RE");
        }
    }
}
What is the result?

Options :
Answer: C

Question 5

Question ID: UK8294624
Given code:
package com.examtest.ocp;
 
class Outer {
    private String msg = "A";
    public void print() {
        final String msg = "B";
        class Inner {
            public void print() {
                System.out.println(this.msg);
            }
        }
        Inner obj = new Inner();
        obj.print();
    }
}
 
public class Test {
    public static void main(String[] args) {
        new Outer().print(); 
    }
}
What is the result?

Options :
Answer: A

© Copyrights Oracledumps 2025. 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.