Two strange returns, a string that describes the object.
In this lesson learned at a tutoring method to each child class inside the short class, auto generated
tutoring method.
I'll copy this three times.
Change the following words.
And we're going to add to this to string the result from calling get price superdog that color.
And Superdog Brend.
OK, let's print one of the objects.
At a break point.
Debug the runtime.
We already know that Java internally calls the tutoring method when you print an object.
Get size calls the local GETER, which returns the size field of the current object, calling this method.
Super refers to the super class, the parent class, so super doget price is going to call the get price
method inside the parent class.
Get price returns, the price field of the current object that's calling this method.
Superdog, that color is going to call the get color method inside the parent class.
Get color returned to the color field of the current object that's calling this method.
Superdog brand is going to call the get brand method inside the parent class.
Get brands returned to the brand field of the current object that's calling this method.
And now we have a nice string that describes the object.
Let's just do the same thing inside the pants class.
Auto generate the two string method.
And the tutoring method needs to fully describe the object, so we're going to add to the string the
result from calling Superdog get price.
Superdog, that color.
Superdog at Brand.
And we should be good.
You added a two string method to each child class.