Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Potential error on page 21 (Sybex)  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 21 of the OCAJP8, it says:

"Table 1.1 shows the Java primitive types together with their size in bytes and the range of value that each holds."

Shouldn't that be "bits" instead of "bytes"?
 
Marshal
Posts: 5635
390
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since we don't know which book you are talking about, but anyways, if book mentions 'bytes' in that context', sure, there must be 'bits'.
 
Liutauras Vilda
Marshal
Posts: 5635
390
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch, Eagle Eye Bart Presso
 
Bart Presso
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:Since we don't know which book you are talking about, but anyways, if book mentions 'bytes' in that context', sure, there must be 'bits'.



It's in the OCAJP8 Study Guide by Boyarsky and Selikoff, the book's website (https://www.selikoff.net/java-oca-8-programmer-i-study-guide/) said to post potential errors here :-)
 
Bart Presso
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:And welcome to the Ranch, Eagle Eye Bart Presso



And thank you!
 
Marshal
Posts: 58830
179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The correct figures are
byte=1, char=2, short=2, int=4, long=8, float=4, double=8, if using bytes.
The correct figures are
byte=8, char=16, short=16, int=32, long=64, float=32, double=64, if using bits.
If using bats, bets, bots, buts or byts, the values are undefined.

[later edit]Yes, that link is the correct place for suspected errors. There are two links on the same website, one for the OCA book and one for the OCP book.
 
Bartender
Posts: 770
27
Eclipse IDE Hibernate jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bart Presso wrote:Shouldn't that be "bits" instead of "bytes"?

Just checked in the book, Agreed.
 
author & internet detective
Marshal
Posts: 38152
617
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confirmed and added to the errata
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!