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

Question ID: UK8296394Consider 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: UK8297735Given code of Test.java file:package com.examtest.ocp; public class Test {    enum TrafficLight {        private String message;        GREEN("go"), AMBER("slow"), RED("stop");                TrafficLight(String message) {            this.message = message;        }                public String getMessage() {            return message;        }    }        public static void main(String[] args) {        System.out.println(TrafficLight.AMBER.getMessage().toUpperCase());    }} What is the result?

Options :
Answer: C

Question 3

Question ID: UK8298565Consider below code of Test.java file:package com.examtest.ocp;  public class Test {    public static void main(String[] args) {        String str = "*";        /*INSERT*/        System.out.println(str);    }}Which of the following options, if used to replace /*INSERT*/, will compile successfully and on execution will print ***** on to the console?Choose 2 options.

Options :
Answer: A,B

Question 4

Question ID: UK8296388Consider below code of Test.java file:package com.examtest.ocp;  public class Test {    public static void main(String[] args) {        final var str = "+";        System.out.println(str.repeat(2) == "++");    }}What is the result?

Options :
Answer: B

Question 5

Question ID: UK8298570Consider below code of Test.java file:package com.examtest.ocp;  public class Test extends String {    @Override    public String toString() {        return "TEST";    }        public static void main(String[] args) {        Test obj = new Test();        System.out.println(obj);    }}What is the result?

Options :
Answer: D

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.