JAVA in a Nutshell by David Flanagan The following errata were *corrected* in the 11/06 reprint. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy. This page was updated March 19, 2007. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification +n: n'th paragraph from the top of the page -n: n'th paragraph from the bottom of the page ######################################## (21) -1 primitive types as secribed in -> primitive types as described in ######################################## [38] Left shift (<<), line 4 2n -> 2^n ######################################## [38] Signed right shift (>>), last line 2n -> 2^n ######################################## (89) +3 make it much simple to use -> make it much simpler to use ######################################## {219} lines 13 and 14 of monthlyPayment(...) method The corrected version follows: // Compute monthly interest payments on a loan public static BigDecimal monthlyPayment(int amount, // amount of loan int years, // term in years double apr) // annual interest % { // BigDecimal can compute arbitrary precision results. // But this causes problems with repeating decimals on division, // and can take a long time for exponentiation. So we use a // MathContext to specify how much precision we want MathContext c = MathContext.DECIMAL128; // Convert the loan amount to a BigDecimal BigDecimal principal = new BigDecimal(amount); // Convert term of loan in years to number of monthly payments int payments=years*12; // Convert interest from annual percent to a monthly decimal BigDecimal interest = BigDecimal.valueOf(apr); interest = interest.divide(new BigDecimal(100)); // as fraction interest = interest.divide(new BigDecimal(12), c); // monthly // The monthly payment computation BigDecimal x = interest.add(BigDecimal.ONE).pow(payments, c); BigDecimal y = principal.multiply(interest).multiply(x); BigDecimal monthly = y.divide(x.subtract(BigDecimal.ONE), c); // Convert to two decimal places monthly = monthly.setScale(2, RoundingMode.HALF_EVEN); return monthly; } ######################################## (250) +1, last full line from the threads computations -> from the threads' computations ######################################## (289) center of page; String filepass = "KeyStore password" // Password for entire file. -> String filepass = "KeyStore password"; // Password for entire file. ######################################## {313} +2 @returns -> @return ######################################## (397) -1 file creation methods have were added in Java 1.2. -> file creation methods were added in Java 1.2. ######################################## (447) 5th line from bottom public float floatValue();yu -> public float floatValue(); ######################################## (462) -2 returning a the wrapped double value -> returning a wrapped double value ######################################## (882) line 5 of Level paragraph The constant ALL enable logging -> The constant ALL enables logging ########################################