• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
Greenhorn
Posts: 19
Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • 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: 71629
312
  • Mark post as helpful
  • send pies
  • 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: 19
Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • 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: 40354
819
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed this is a typo. Added to errata list.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic