This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Possible errata on p54 about Java primitives & String? (Java OCA 8 Programmer I Study Guide, Sybex)

 
Greenhorn
Posts: 9
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
3rd last paragraph on p. 54 reads:

All of the arithmetic operations may be applied to any Java primitives, except boolean and String.



Table 1.1 on p. 21 lists the Java primitive types - however String is not listed as a primitive.

Even though String is treated specially, it isn't a primitive - as far as I know
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Juliet Smith wrote:Table 1.1 on p. 21 lists the Java primitive types - however String is not listed as a primitive.

Even though String is treated specially, it isn't a primitive - as far as I know


You are correct! Although String literals are treated in a special way, String is definitely not a primitive. It's not listed as one of the Primitive Data Types.

Hope it helps!
Kind regards,
Roel
 
author & internet detective
Posts: 41775
887
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
Good find. Have a cow. I've added this to the errata.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just for the record (and completeness): the + operator will work on String, but will not perform addition (like with two ints), but concatenation. So for all primitives (except boolean) the + is an arithmetic operator for addition (and that's including chars!), and for Strings it's a concatenation operator for (obviously) concatenating.

Pop quiz question time! Do you know the output of this code snippet? And "yes" or "no" is not a valid answer

Hope it helps!
Kind regards,
Roel
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic