Wrox Programmer Forums
|
BOOK: Beginning Java Programming: The Object Oriented Approach
This is the forum to discuss the Wrox book Beginning Java Programming: The Object Oriented Approach by Bart Baesens, Aimee Backiel, Seppe vanden Broucke; ISBN: 978-1-118-73949-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java Programming: The Object Oriented Approach section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2015, 01:33 PM
Registered User
 
Join Date: Mar 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Book Errors / Missing Instructions

Chapter 7: Try It Out (Implementing Interfaces)
  • created exceptions (IllegalDeposit, IllegalWithdrawal, IllegalAccount) must have classes created for each one of them that all extend Exception
  • inside of each of the custom-made exception classes, you will need to either utilize the @SuppressWarnings("serial) annotation right before the class declaration, OR add a default or generated serial version ID. Since I don't currently know what these ID's are used for, I am simply suppressing the serial warnings.
  • In the CheckingAccount class, inside of the isValidDeposit( ) method, inside of the if statement, remove the "new" in front of BigDecimal.ZERO

Chapter 8: Try It Out (Copying and Showing Files Line by Line with Buffered Streams)
  • Inside of class FileCopier, inside of the try-with-resources block (specifically, within try's resource declarations within the parentheses after 'try') Change "Reader in" to "BufferedReader in"

Last edited by OminousAshes; May 29th, 2015 at 09:09 PM.. Reason: updated - more information
 
Old March 10th, 2016, 09:26 AM
Registered User
 
Join Date: Mar 2016
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default More errata and comments on the reporting of such

I just reported some errata for this book, but first I'd like to mention what a painful and time-consuming process it was. Why on earth I need to create an account and provide personal details such as my mailing address is beyond me. There must have been 30 required fields to complete, and the software doesn't even know which book for which I'm reporting errata, even though I accessed the errata form right from its page. Sigh.

I suspect this will discourage people from reporting errata. I nearly gave up, but persevered with the satisfaction of coming here to express my displeasure.

The errata I reported was:
page 21 - the variable BMI doesn't follow lowerCamelCase and isn't even used in the program.

page 37 - 2 of the 3 array indexes in the MatrixExample are incorrect.

Things like this are frustrating for beginner programmers.
 
Old March 10th, 2016, 09:34 AM
Registered User
 
Join Date: Mar 2016
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default An annoyance

This isn't technically errata, but rather an annoyance that in my opinion should be corrected.

In the introduction the authors state quite clearly, "you will not find the archetypical (and honestly, completely useless) “Hello World” example in this book."

I would tend to disagree that a "Hello World" program is useless, and so do the authors, as this program appears twice, first on page 43, and then again on 57.

Code:
/** * This is a simple Java application. 
* It prints a short statement to the standard output. 
*/

class MyFirstApplication {
    public static void main(String[] args){
        System.out.println("I've coded, compiled, and run my first Java program!");
    } 
}
If that isn't a "Hello World" program, I don't know what is. As I mentioned, I think these types of programs do have worth, but I would remove the misleading and "completely useless" comment from the Introduction.
 
Old March 13th, 2016, 09:56 PM
Registered User
 
Join Date: Mar 2016
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Really awful mistake

I came across a truly laughable mistake in the book. Have a look at this Enhanced For example from page 143 and see if you can spot the error.

Code:
public class TestClass {
    
    public static void main(String[] args) {
        int[] sales2014 = {500,720,515,377,400,435,510,1010,894,765,992,1125}; 
        int[] staff2014 = {7,5,5,5,5,6,6,7,7,8,9,9}; 
        int[] salesPerStaff = new int[12]; 
        int totalSales2014 = 0;
        
        for (int i: sales2014) {    
            salesPerStaff[i] = sales2014[i]/staff2014[i];
            totalSales2014 = totalSales2014 + sales2014[i]; 
        }
    }   
}
It uses the iterator as an index, and immediately causes an array index out of bounds error. The iterator steps through the sales2014 array, but tries to use the values in the array like an index into the salesPerStaff array. Since the first value in the sales 2014 array is 500, it tries to access salesPerStaff[500] which doesn't exist.

Really disappointing, and quite misleading for readers. This isn't a typo, it's a total conceptual mistake.

And I've noticed numerous little errors throughout the book, like on page 146 where it reads, "You’ve probably noticed that many of the standard for loops shown in this chapter use x as the index name (and x = 0 as the initialization); this is by no means required, but is often used in practice."

Besides the awkward sentence construction, the error is that x hasn't been used once for an index name, it's always been i. These types of little mistakes are scattered throughout this book.

Anyway, I've decided this book is too full of errors to continue to use it, so I won't be reporting any more errata or other issues.

Not recommended.

Last edited by itDontMeanAThing; March 13th, 2016 at 10:02 PM..
 
Old July 2nd, 2016, 11:29 AM
Registered User
 
Join Date: Jul 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax errors

I've just started reading this book, Beginning Java Programming - Object Oriented Programming, and I've noticed the same errors that were highlighted already, plus another one:

On page 31, in table 2-10, Bitwise Operators, a text error is in the second box area. It says, 'Bitwise OR operator: Puts a 1 bit in the result if one of both input operands have a 1 bit at the given position.'

It should say, '... if one or both input ... ', instead it says ... 'if one of both input ...'.

Last edited by InfiniteLearning; July 2nd, 2016 at 11:31 AM.. Reason: I noticed i hadn't included the proper explanation
 
Old August 31st, 2016, 11:20 AM
Registered User
 
Join Date: Aug 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Error in code on page 101

Same Error in code on pages 101 and 102:

Code:
public static void main(String[] args) {
Book firstBook = new Book("First Book", 2004);
Book secondBook = new Book("Another Book", 2014);
firstBook.sell(200);
System.out.println("Number of copies sold of first book is now: "
+firstBook);
System.out.println("Title of the second book is: "+secondBook.title);
}
Should be:

Code:
public static void main(String[] args) {
Book firstBook = new Book("First Book", 2004);
Book secondBook = new Book("Another Book", 2014);
firstBook.sell(200);
System.out.println("Number of copies sold of first book is now: "
+firstBook.copiesSold);
System.out.println("Title of the second book is: "+secondBook.title);
}

Last edited by Fira; August 31st, 2016 at 11:25 AM..
 
Old December 21st, 2016, 05:10 PM
Registered User
 
Join Date: Dec 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table 2-12 Truth table (p33) error

Is there a mistake in row 3 of the 'OR' column or is it just me?
Operand 1 = False, Operand 2=True so surely the 'OR' should be True?
 
Old May 17th, 2018, 08:47 AM
Registered User
 
Join Date: May 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Try It Out Inheritance, Superclasses, and Subclasses on page 247

I took all the code of this example in my IDE, but still get a very weird error: When I run the example, I get the "Invalid withdrawal" sometimes at the beginning, sometimes in the end of the "log". I wonder how this inconsistent behaviour can be explained? Maybe some variable is not newly initialised in the re-run?

Also, I find it strange that for the opening of the account one does not use the deposit method. This would be more logical, since it is also used for the bonus given at opening a savings account. Then both processes would have the same validation.

Furthermore, I would prefer if the author gives the correct result (the log) into the book.

In general the topic of the example is good and I also like that the author makes you think how to write the code, instead of providing the correct code after each step.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 - Missing Instructions Stunpals BOOK: Workflow in SharePoint 2010: Real World Business Workflow Solutions 26 March 12th, 2013 11:38 AM
Book missing code & getting errors when I run it Rachel BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 1 March 18th, 2009 10:14 AM
Missing code and errors dba BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 January 15th, 2008 01:34 PM
Book Errors? zoltac007 BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 June 6th, 2006 06:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.