Exam Code: 1Z0-829
Exam Questions: 660
Java SE 17 Developer
Updated: 03 Sep, 2026
Viewing Page : 1 - 66
Practicing : 1 - 5 of 660 Questions
Question 1

Question ID: UK8292005Given code of Test.java file:package com.examtest.ocp; public class Test {    private T t;     public T get() {        return t;    }     public void set(T t) {        this.t = t;    }     public static void main(String args[]) {        Test obj = new Test();        obj.set("OCP");        obj.set(85);        obj.set('%');         System.out.println(obj.get());    }}What is the result?

Options :
Answer: D

Question 2

Question ID: UK8292410Consider below code of Test.java file:package com.examtest.ocp; public class Test {    public static void main(String[] args) {        Boolean b = Boolean.valueOf("tRUe");        switch(b) {            case true:                System.out.println("ONE");            case false:                System.out.println("TWO");            default:                 System.out.println("THREE");        }    }}What is the result of compiling and executing Test class?

Options :
Answer: D

Question 3

Question ID: UK8292478Given code of Test.java file:package com.examtest.ocp; import java.util.Arrays; public class Test {    public static void main(String[] args) {        int [] array1 = {};        int [] array2 = {100, 200};        System.out.print(Arrays.compare(array1, array2));        System.out.print(Arrays.mismatch(array1, array2));    }}What is the result?

Options :
Answer: A

Question 4

Question ID: UK8291549Given 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 5

Question ID: UK8291585Given code of Test.java file:package com.examtest.ocp; public class Test {    public static void main(String[] args) {        var i = 1;        var j = 5;        var k = 0;        A: while(true) {            i++;            B: while(true) {                j--;                C: while(true) {                    k += i + j;                    if(i == j)                        break A;                    else if (i > j)                        continue A;                    else                         continue B;                }            }        }        System.out.println(k);    }}What is the result?

Options :
Answer: A

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

© Copyrights FreePDFQuestions 2026. All Rights Reserved

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