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.