View Single Post
  #1 (permalink)  
Old 04-21-2008, 05:52 AM
Nari Nari is offline
Member
 
Join Date: Nov 2007
Posts: 11
Nari is on a distinguished road
please help with exam problems
please help!!!

i have a exam tomorrow.

5) Draw an inheritance hierarchy to represent a shoe object. The base class should have derived classes of Dress Shoes, Tennis Shoes and Boots.

6) Implement the base class in the shoe hierarchy in number 5 above.
public class Shoe
{ private String color;
private String designer;
private double size;

7) Derive a class named Dress Shoes from the base class created in number 6 above
public class DressShoe extends Shoe
{
private String type; //valid types include pumps, heels and flats



8) Derive a class named Tennis Shoes from the base class created in number 6 above.
public class TennisShoe extends Shoe
{
private String soleType;
private String canvasType;


9) Derive a class named Boots from the base class created in number 9 above.

public class Boot extends Shoe
{
private String heelType; //valid types include pumps, heels and flats
10) Override the clone method inherited in the Dress Shoes class created in number 7 above.

11) Override the clone method inherited in the Tennis Shoes class created in number 8 above.

12) Override the clone method inherited in the Boots class created in number 9 above.
Reply With Quote
Sponsored Links