Albert Attard

Greenhorn
+ Follow
since Apr 19, 2022
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Albert Attard

Sorry if I was not clear.  Is there a template that I can follow when reposting such things, please?
Is this the right forum where we can raise potential errata about the OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829 book?
Hello.

With reference to section "Applying Unary Operators" in Chapter 2 (of the book OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829).

The unary plus operator (+) does not indicate whether a number is positive.  It promotes a variable to an int (https://docs.oracle.com/javase/specs/jls/se17/html/jls-15.html#jls-15.15.3).

Consider the following example.



The above example will print



You can try it with all other types (byte and short).


Hello,

With the risk of being pedantic - With reference to the section with title "Distinguishing between Primitives and Reference Types" (in the book OCP Oracle Certified Professional Java SE 17 Developer Study Guide: Exam 1Z0-829), it says that we cannot call methods on null objects (see attached image).

This is not 100% correct as we can call static methods on null objects as shown below.

Question 9, in the introduction chapter, shows the following module definition.



Is this a valid, Java 17, model definition?  I am asking this question as the above does not compile and produces the following error.



The options available do not include compilation errors, as shown in the attached file.