«
^
»
10.3 The use of java.lang.Override
The above code is legal, but is not doing what you intended.
When you come to use these methods,
you will get a result different from what you expected. For example:
0725: Shape tShape = shapes[shapeNumber]; 0726: System.out.println(tShape);
will use the
toString
method from the class
Object
.
The above is so typical of what happens: it is so easy to get the wrong spelling or the wrong parameters.