Advertisement
IrinaIgnatova

examSoftUni Parking-classCar

Dec 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.39 KB | None | 0 0
  1. //
  2. // Source code recreated from a .class file by IntelliJ IDEA
  3. // (powered by Fernflower decompiler)
  4. //
  5.  
  6. package softUniParking;
  7.  
  8. public class Car {
  9.     private String make;
  10.     private String model;
  11.     private int horsePower;
  12.     private String registrationNumber;
  13.  
  14.     public Car(String make, String model, int horsePower, String registrationNumber) {
  15.         this.make = make;
  16.         this.model = model;
  17.         this.horsePower = horsePower;
  18.         this.registrationNumber = registrationNumber;
  19.     }
  20.  
  21.     public String getMake() {
  22.         return this.make;
  23.     }
  24.  
  25.     public void setMake(String make) {
  26.         this.make = make;
  27.     }
  28.  
  29.     public String getModel() {
  30.         return this.model;
  31.     }
  32.  
  33.     public void setModel(String model) {
  34.         this.model = model;
  35.     }
  36.  
  37.     public int getHorsePower() {
  38.         return this.horsePower;
  39.     }
  40.  
  41.     public void setHorsePower(int horsePower) {
  42.         this.horsePower = horsePower;
  43.     }
  44.  
  45.     public String getRegistrationNumber() {
  46.         return this.registrationNumber;
  47.     }
  48.  
  49.     public void setRegistrationNumber(String registrationNumber) {
  50.         this.registrationNumber = registrationNumber;
  51.     }
  52.  
  53.     public String toString() {
  54.         return String.format("Make: %s%nModel: %s%nHorsePower: %d%nRegistrationNumber: %s", this.make, this.model, this.horsePower, this.registrationNumber);
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement