Thursday, July 15, 2010

package org.cs212.hello;
public class MountainBike extends Bicycle{
      private String suspension;
      public double name;
     
      public MountainBike(int startCadence, int startSpeed, int startGear, String suspensionType){
        super(startCadence, startSpeed, startGear);
        this.setSuspension(suspensionType);
      }

      public String getSuspension(){
        return this.suspension;
      }

      public void setSuspension(String suspensionType){
        this.suspension = suspensionType;
      }

      public void printDescription(){
        super.printDescription();
        System.out.println("The MountainBike has a " + getSuspension()
                + " suspension.");
      }
    }

No comments:

Post a Comment