This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm having trouble getting the 17 to display where the "_____'s" are. I cannot simply plug in 17. I have tried various things and I cannot get any to work. Any guidance/suggestions/help would be appreciated. Thanks.
Originally posted by ken zemaitis: ... I tried to use x and my System.out.println gave me the response "Number@108786b is ODD." I didn't understand why I got that either.
All classes already have a toString method inherited from the base class Object. The implementation of toString in Object is to return a String concatenation of the class name, an "at" sign, and a memory location. This is why the method needs to be overridden in subclasses to return a more meaningful String.