Fill Preparation Gaps with Free Online 1Z0-829 Exam Practice

Exam Code: 1Z0-829
Exam Questions: 660
Java SE 17 Developer
Updated: 01 May, 2025
Question 1

Question ID: UK8295941
Given code of TestStudent.java file:
package com.examtest.ocp;
 
class Student {
    String name;
    int age;
    boolean result;
    double height;
}
 
public class TestStudent {
    public static void main(String[] args) {
        var stud = new Student(); //Line n1
        System.out.println(stud.name + stud.height + stud.result + stud.age); //Line n2
    }
}
What is the result?

Options :
Answer: A

Question 2

Question ID: UK8291549
Given code of Test.java file:
package com.examtest.ocp;
 
public class Test {
    private static void m(int i) {
        System.out.print(1);
    }
    
    private static void m(int i1, int i2) {
        System.out.print(2);
    }
    
    private static void m(char... args) {
        System.out.print(3);
    }
   
    public static void main(String... args) {
        m('A');
        m('A', 'B');
        m('A', 'B', 'C');
        m('A', 'B', 'C', 'D');
    }
}
What is the result?

Options :
Answer: C

Question 3

Question ID: UK8293374
Which of the following are Java Exception classes?
Choose 3 options.

Options :
Answer: A,C,D

Question 4

Question ID: UK8295518
How many of the below code statements, written inside main method will compile successfully?
1. var arr1 = new int[]{10};
2. var arr2 = new String[][] {};
3. var arr3 = new char[][] {{}};
4. var arr4 = {10, 20, 30};
5. var arr5 = new String[][] {new String[]{"LOOK"}, new String[] {"UP"}};
6. var [] arr6 = new int[] {2, 3, 4};

Options :
Answer: A

Question 5

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

Viewing Page : 1 - 66
Practicing : 1 - 5 of 660 Questions

© 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.