Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapplication29;
- /**
- *
- * @author fmi
- */
- public class Car extends Vehicle {
- private String carType;
- public Car(String carType){
- this.carType = carType;
- }
- @Override
- public String getCarType() {
- return carType;
- }
- public void setCarType(String carType) {
- this.carType = carType;
- }
- @Override
- public String pushBreak(){
- return "The car stops";
- }
- @Override
- public String pushClutch(){
- return "Change shift";
- }
- @Override
- public String pushAxelerate(){
- pumpGazoline();
- return "The car axelerates!";
- }
- @Override
- public String turnWeel(){
- return "Turn lef or right";
- }
- @Override
- public String shiftGear(){
- return "Change Gear";
- }
- private int pumpGazoline(){
- return 4;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement