• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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: 79967
396
  • 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: 42003
911
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.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic