1Z0-829 Exam Questions & Answers
Java SE 17 Developer • Oracle
100% money-back guarantee
Sample 1Z0-829 Questions
Practice with real exam-style questions, each with the verified correct answer and explanation.
Given:

Which action enables the code to compile?
The answer is C because the code fragment contains a syntax error in line 7, where the method display is declared without any parameter type. This causes a compilation error, as Java requires the parameter type to be specified for each method parameter. To fix this error, the parameter type should be added before the parameter name, such as string design. This will enable the code to compile and run without any errors.Reference:
Oracle Certified Professional: Java SE 17 Developer
OCP Oracle Certified Professional Java SE 17 Developer Study Guide
Which two code fragments compile?
A)

B)

C)

D)

E)

The two code fragments that compile are B and E. These are the only ones that use the correct syntax for declaring and initializing a var variable. The var keyword is a reserved type name that allows the compiler to infer the type of the variable based on the initializer expression. However, the var variable must have an initializer, and the initializer must not be null or a lambda expression. Therefore, option A is invalid because it does not have an initializer, option C is invalid because it has a null initializer, and option D is invalid because it has a lambda expression as an initializer. Option B is valid because it has a String initializer, and option E is valid because it has an int initializer.
https://docs.oracle.com/en/java/javase/17/language/local-variable-type-inference.html
Given the code fragment:

Which code fragment invokes all callable objects in the workers set?
A)

B)

C)

D)

Given the code fragment:

What is the result?
Given the code fragment:

What is the result?
False: because not all of the elements in specialDays are equal to ''Labour'' or ''Halloween''.
true: because at least one of the elements in specialDays is equal to ''Labour'' or ''Halloween''.
true: because none of the elements in specialDays are equal to both ''Labour'' and ''Halloween''.
Get access to all 50 verified questions with detailed answers.
Unlock All 1Z0-829 Questions