Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package MoreExercise_3_CarSalesman;
- public class Car {
- public String getCarModel() {
- return carModel;
- }
- public Engine getEngine() {
- return engine;
- }
- public String getCarWeight() {
- return carWeight;
- }
- public String getCarColour() {
- return carColour;
- }
- @Override
- public String toString() {
- return String.format("\n" +
- "%s\n" +
- "Weight: %s\n" +
- "Color: %s", this.engine, this.carWeight, this.carColour);
- }
- public Car(String carModel, Engine engine, String carWeight, String carColour) {
- this.carModel = carModel;
- this.engine = engine;
- this.carWeight = carWeight;
- this.carColour = carColour;
- }
- private String carModel;
- private Engine engine;
- private String carWeight;
- private String carColour;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement