Derive a class named Tennis Shoes from the base class created in number 9 above.
What will be an ideal response?
```
public class TennisShoe extends Shoe
{
private String soleType;
private String canvasType;
public TennisShoe()
{
super();
soleType = "";
canvasType = "";
}
public TennisShoe(String c, String d, double s, String st, String ct)
{
super(c, d, s);
setSoleType(st);
setCanvasType(ct);
}
public void setSoleType(String st)
{
soleType = st;
}
public void setCanvasType(String ct)
{
canvasType = ct;
}
public String getSoleType()
{
return soleType;
}
public String getCanvasType()
{
return canvasType;
}
public String toString()
{
return ("This tennis shoe is designed by: " + this.getDesigner() +
"\nColor: " + getColor() + "\nSize: " + getSize() +
"\nSole type: " + getSoleType() +
"\nCanvas type: " + getCanvasType());
}
public boolean equals(Object o)
{
if(o == null)
return false;
else if(getClass() != o.getClass())
return false;
else
{
TennisShoe otherTennisShoe = (TennisShoe) o;
return
(getDesigner().equals(otherTennisShoe.getDesigner())
&&
getColor().equals(otherTennisShoe.getColor()) &&
getSize() == otherTennisShoe.getSize() &&
soleType.equals(otherTennisShoe.soleType) &&
canvasType.equals(otherTennisShoe.canvasType));
}
}
}
```
You might also like to view...
What is a single item in an array called?
What will be an ideal response?
____ adds structure to search results by providing the results in a table, or square, instead of as a list of Web sites.
A. Google Chrome B. Google Squared C. Google Bing D. Google Directory