Patrick Nodder wrote:I believe there is an error on page 126 (Chapter 3). On the last line an extra set of brackets is needed to make space a 3D array.
You are incorrect! The study guide is spot-on and space is definitely a 3D array, but I agree the statement is a bit tricky and misleading. That's why you shouldnever use this kind of statements in a real software product.
The statement from the study guideis equivalent toAs you can see the brackets with the type apply to both variables, but the brackets with the variable name only apply to the corresponding variable. So using this confusing code style you can define arrays with a different dimension in the same statement. And to really illustrate (and proof) space is really a 3D-array, you can try to initialize this array using the following codeOnly line3 successfully compiles; line1 and line2 will give a compiler error because the dimension at the right-hand side does not match with the actual dimension of the space array (which is 3).
Hope it helps!
PS. You have posted your errata item in the errata thread of the K&B7 study guide. This is a study guide for the OCAJP7 certification exam and thus different than the study guide you are currently reading, which is for the OCAJP8 certification exam. If you spot another (possible) errata item, you can simply create a new topic in this forum (instead of posting a reply in the K&B7 errata thread).