Advertisement
Guest User

Untitled

a guest
Jun 8th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. public class Car {
  2.     private String model;
  3.     private Engine engine;
  4.     private String weight;
  5.     private String color;
  6.  
  7.  
  8.     public Car(String carModel, Engine engine, String weight, String color) {
  9.         this.model = carModel;
  10.         this.engine = engine;
  11.         this.weight = weight;
  12.         this.color = color;
  13.     }
  14.  
  15.     public String getEngineModel() {
  16.         return this.engine.getModel();
  17.     }
  18.  
  19.     public String getEnginePower() {
  20.         return this.engine.getPower();
  21.     }
  22.  
  23.     public String getEngineDisplacement() {
  24.         return this.engine.getDisplacement();
  25.     }
  26.  
  27.     public String getEngineEfficiency() {
  28.         return this.engine.getEfficiency();
  29.     }
  30.  
  31.     public String getWeight() {
  32.         return this.weight;
  33.     }
  34.  
  35.     public String getColor() {
  36.         return this.color;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement