Advertisement
alexj90

Untitled

Feb 1st, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package raw_data;
  2.  
  3. import java.awt.dnd.InvalidDnDOperationException;
  4.  
  5. public class Car {
  6. private String model;
  7. private Engine engine;
  8. private Cargo cargo;
  9. private Tire[] tires;
  10.  
  11. public Car(String model, Engine engine, Cargo cargo, Tire[] tires) {
  12. if (tires.length != 4) {
  13. throw new InvalidDnDOperationException("Tires can not be no more neither less than 4!!!");
  14. }
  15. this.model = model;
  16. this.engine = engine;
  17. this.cargo = cargo;
  18. this.tires = tires;
  19. }
  20.  
  21. public String getModel() {
  22. return this.model;
  23. }
  24.  
  25. public Engine getEngine() {
  26. return this.engine;
  27. }
  28.  
  29. public Cargo getCargo() {
  30. return this.cargo;
  31. }
  32.  
  33. public Tire[] getTires() {
  34. return this.tires;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement