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...
Which of the following statements is false?
a. Most functions have one or more parameters and possibly local variables that need to exist while the function is executing, remain active if the function makes calls to other functions, and “go away” when the function returns to its caller. b. A called function’s stack frame is the perfect place to reserve memory for the function’s local variables. c. A called function’s stack frame is popped when the function is called and ex-ists while the function is executing. d. When a function returns, it no longer needs its local variables, so its stack frame is popped from the stack, and its local variables no longer exist.
Which of the following is a scripting language?
A. Ruby B. Perl C. PHP D. All of the above
A Chief Executive Officer (CEO) decided that only a limited number of authorized company workstations will be able to connect to the Internet. Which of the following would BEST accomplish this goal?
A. Use content filtering B. Install and configure IDS C. Enable MAC address filtering D. Enable RAS on the network firewall
All browsers can automatically display a calendar in a date field.
Answer the following statement true (T) or false (F)