Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Java OCP 11 Developer Complete Study Guide errata

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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: 227
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yes thanks
 
Marshal
Posts: 70625
288
  • Mark post as helpful
  • send pies
  • 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
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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: 70625
288
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all I'm gonna say is int O_O = 0_0;

 
Campbell Ritchie
Marshal
Posts: 70625
288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
O
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic