Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 22
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: 74780
336
  • 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: 22
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: 40912
840
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic