Java 6 in 21 Days (5th Edition) Day 2: The ABCs of Programming

The cover of Teach Yourself Java 6 in 21 Days (5th Edition) by Rogers Cadenhead and Laura Lemay

Home Feedback Other Books Previous Day Next Day

Notes and Corrections

  • View the Certification Practice quiz solution
  • Certification answer: Answer (c) is correct.

    Answer (a) is incorrect. The short and int data types cannot hold a number that large. A short variable can hold numbers from -32,768 to 32,767 and an int variable can hold numbers from -2,147,483,648 to 2,147,483,647.

    Answer (b) is incorrect. The int data type holds numbers from -2,147,483,648 to 2,147,483,647.

    Answer (d) is incorrect. The byte data type holds numbers from -128 to 127.

  • Page 40: The minus signs are missing from values in Table 2.1: Integer Types. The range for byte values is from -128 to 127, for short values is from -32,768 to 32,767, for int values is from -2,147,483,648 to 2,147,483,647, and for long values is from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
  • Pages 49-50: The comments in the Celsius conversion section of the Weather application (Listing 2.2) were incorrect. The Weather.java source code has been updated to reflect the correct comments.

Source Files

Activities