• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Errata OCP Java SE 11 Programmer I Study Guide (Sybex Appendix A - p.506) from Jeanne and Scott

 
Greenhorn
Posts: 24
Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following paragraph is taken from OCP Java  SE 11 Programmer I Study Guide (Sybex Appendix A - p.506) from Jeanne boyarsky and Scott Selikoff

The first line in the last paragraph says

For the second part, a += 2 expands to a = a + 2.



It should be

For the second part, s2 += 2 expands tos2 = s2 + 2.




Muhammad Shah
https://www.youtube.com/channel/UCZC5KfHgb_nQVedKY0MMhLw?view_as=subscriber
 
Marshal
Posts: 77517
372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please avoid coloured text, which many people can't read. I have changed your text to black.
Why is that an error? B&S are using a as a generic variable name.
 
Amir Shah
Greenhorn
Posts: 24
Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Please avoid coloured text, which many people can't read. I have changed your text to black.
Why is that an error? B&S are using a as a generic variable name.



They are not using "a" as generic variable name. Please read the following question of OCP Java  SE 11 Programmer I Study Guide (Sybex Ch-5 - p.213) from Jeanne boyarsky and Scott Selikoff

9. What is the result of the following code? (Choose all that apply.)

A. 2
B. 4
C. 7
D. 10
E. ==
F. equals
G. An exception is thrown.
H. The code does not compile.



They are trying to explain line 22 In the Appendix A - p. 506 but using the wrong variable a instead of s2.

The first line in the last paragraph says

For the second part, a += 2 expands to a = a + 2.


It should be

For the second part, s2 += 2 expands to s2 = s2 + 2.





 
author & internet detective
Posts: 41577
881
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agreed this is a typo. Added to errata list.
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic