Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package raw_data;
- import java.awt.dnd.InvalidDnDOperationException;
- public class Car {
- private String model;
- private Engine engine;
- private Cargo cargo;
- private Tire[] tires;
- public Car(String model, Engine engine, Cargo cargo, Tire[] tires) {
- if (tires.length != 4) {
- throw new InvalidDnDOperationException("Tires can not be no more neither less than 4!!!");
- }
- this.model = model;
- this.engine = engine;
- this.cargo = cargo;
- this.tires = tires;
- }
- public String getModel() {
- return this.model;
- }
- public Engine getEngine() {
- return this.engine;
- }
- public Cargo getCargo() {
- return this.cargo;
- }
- public Tire[] getTires() {
- return this.tires;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement