Advertisement
wingman007

Java - JavaApplication29 Car.java

Dec 8th, 2013
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.01 KB | None | 0 0
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package javaapplication29;
  6.  
  7. /**
  8.  *
  9.  * @author fmi
  10.  */
  11. public class Car extends Vehicle {
  12.    
  13.     private String carType;
  14.    
  15.     public Car(String carType){
  16.         this.carType = carType;
  17.     }
  18.  
  19.     @Override
  20.     public String getCarType() {
  21.         return carType;
  22.     }
  23.    
  24.     public void setCarType(String carType) {
  25.         this.carType = carType;
  26.     }
  27.    
  28.     @Override
  29.     public String pushBreak(){
  30.         return "The car stops";
  31.     }
  32.     @Override
  33.     public String pushClutch(){
  34.         return "Change shift";
  35.     }
  36.     @Override
  37.     public String pushAxelerate(){
  38.         pumpGazoline();
  39.         return "The car axelerates!";
  40.     }
  41.     @Override
  42.     public String turnWeel(){
  43.         return "Turn lef or right";
  44.     }
  45.     @Override
  46.     public String shiftGear(){
  47.         return "Change Gear";
  48.     }
  49.    
  50.     private int pumpGazoline(){
  51.         return 4;
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement