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

Java OCP 11 Developer Complete Study Guide errata

 
Ranch Hand
Posts: 45
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

on page 69, kindle version, it says: Numeric literals can begin with 1–9, 0, 0x, 0X, 0b, and 0B, with the latter four indicating a change of numeric base.
What about octal numbers? 0 also can indicate change of numeric base, right?
 
Rade Koncar
Ranch Hand
Posts: 45
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also on page 538: Instantiating an inner class requires an instance of the outer class, such as calling new Outer.new Inner().

It is strange that Outer refers to the instance, Capitalized names often indicate a type.
 
Ranch Hand
Posts: 229
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rade Koncar wrote:Also on page 538: Instantiating an inner class requires an instance of the outer class, such as calling new Outer.new Inner().

It is strange that Outer refers to the instance, Capitalized names often indicate a type.



"Outer" refers the type, not the instance. The instance is "new Outer()".
 
Rade Koncar
Ranch Hand
Posts: 45
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh yes thanks
 
Marshal
Posts: 74780
336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rade Koncar wrote:. . . with the latter four indicating a change of numeric base. . . .

Please confirm the exact details of the book: is it Boyarsky and Selikoff? Please check here whether that has already been reported as an error; I didn't find it.
I think it would read better as,

. . with the latter five indicating a change of numeric base. . . .

 
Rade Koncar
Ranch Hand
Posts: 45
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Rade Koncar wrote:. . . with the latter four indicating a change of numeric base. . . .

Please confirm the exact details of the book: is it Boyarsky and Selikoff? Please check here whether that has already been reported as an error; I didn't find it.
I think it would read better as,

. . with the latter five indicating a change of numeric base. . . .



Latter five would indicate that 0 is octal zero, and octal zero is in fact 00.
I think the best thing would be to rephrase the whole thing

this is a copy/paste from my kindle:

Numeric literals can begin with 1–9, 0, 0x, 0X, 0b, and 0B, with the latter four indicating a change of numeric base.
Boyarsky, Jeanne. OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide (p. 70). Wiley. Kindle Edition.
 
Campbell Ritchie
Marshal
Posts: 74780
336
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rade Koncar wrote:. . . Latter five would indicate that 0 is octal zero, and octal zero is in fact 00. . . . .

My, that is precise! I would have taken literals starting 0 as octal but you are correct about 0.
Even worse about octal: If you use underscores, how many of the following are valid integer literals?
1_234 01_234 0_1234 _01234 0b_0000_1111 0b0000_1111 0xffff_ffff 0x_ffff_ffff
It does say in the Java® Language Specification (=JLS) that the difference between 0, 00, 0x0, 000, and 0b0 doesn't “[matter] much in practice”.
 
Rade Koncar
Ranch Hand
Posts: 45
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
all I'm gonna say is int O_O = 0_0;

 
Campbell Ritchie
Marshal
Posts: 74780
336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
O
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic