Advertisement
Guest User

Car

a guest
Jul 15th, 2020
620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. import java.util.ArrayList;
  2.  
  3. public class Car {
  4. private String model;
  5. private int engineSpeed;
  6. private int hp;
  7. private int cargoW;
  8. private String cargoType;
  9. private ArrayList<Tyre> tyres;
  10.  
  11. public Car(String model, int engineSpeed, int hp, int cargoW, String cargoType,ArrayList<Tyre>tyres) {
  12. this.model = model;
  13. this.engineSpeed = engineSpeed;
  14. this.hp = hp;
  15. this.cargoW = cargoW;
  16. this.cargoType = cargoType;
  17. this.tyres=tyres;
  18. }
  19.  
  20. public ArrayList<Tyre> getTyres() {
  21. return tyres;
  22. }
  23.  
  24. public void setTyres(ArrayList<Tyre> tyres) {
  25. this.tyres = tyres;
  26. }
  27.  
  28. public String getModel() {
  29. return model;
  30. }
  31.  
  32. public void setModel(String model) {
  33. this.model = model;
  34. }
  35.  
  36. public int getEngineSpeed() {
  37. return engineSpeed;
  38. }
  39.  
  40. public void setEngineSpeed(int engineSpeed) {
  41. this.engineSpeed = engineSpeed;
  42. }
  43.  
  44. public int getHp() {
  45. return hp;
  46. }
  47.  
  48. public void setHp(int hp) {
  49. this.hp = hp;
  50. }
  51.  
  52. public int getCargoW() {
  53. return cargoW;
  54. }
  55.  
  56. public void setCargoW(int cargoW) {
  57. this.cargoW = cargoW;
  58. }
  59.  
  60. public String getCargoType() {
  61. return cargoType;
  62. }
  63.  
  64. public void setCargoType(String cargoType) {
  65. this.cargoType = cargoType;
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement