Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package _13_DEFINING_CLASSES.Exercise_Class._5_Car_Salesman_;
- public class Car {
- private String model;
- private String engine;
- private int weight;
- private String color;
- private int power;
- private int displacement;
- private String efficiency;
- public Car(String model, String engine, int weight, String color,int power, int displacement, String efficiency){
- this.model = model;
- this.engine = engine;
- this .weight = weight;
- this.color = color;
- this.power = power;
- this.displacement = displacement;
- this.efficiency = efficiency;
- }
- public Car(String model, String engine, int weight,int power, int displacement, String efficiency){
- this.model = model;
- this.engine = engine;
- this .weight = weight;
- this.color = "n/a";
- this.power = power;
- this.displacement = displacement;
- this.efficiency = efficiency;
- }
- public Car(String model, String engine, String color,int power, int displacement, String efficiency){
- this.model = model;
- this.engine = engine;
- this .weight = -1;
- this.color = color;
- this.power = power;
- this.displacement = displacement;
- this.efficiency = efficiency;
- }
- public Car(String model, String engine,int power, int displacement, String efficiency){
- this.model = model;
- this.engine = engine;
- this .weight = -1;
- this.color = "n/a";
- this.power = power;
- this.displacement = displacement;
- this.efficiency = efficiency;
- }
- public String getModel() {
- return model;
- }
- public void setModel(String model) {
- this.model = model;
- }
- public String getEngine() {
- return engine;
- }
- public void setEngine(String engine) {
- this.engine = engine;
- }
- public int getWeight() {
- return weight;
- }
- public void setWeight(int weight) {
- this.weight = weight;
- }
- public String getColor() {
- return color;
- }
- public void setColor(String color) {
- this.color = color;
- }
- public int getPower() {
- return power;
- }
- public void setPower(int power) {
- this.power = power;
- }
- public int getDisplacement() {
- return displacement;
- }
- public void setDisplacement(int displacement) {
- this.displacement = displacement;
- }
- public String getEfficiency() {
- return efficiency;
- }
- public void setEfficiency(String efficiency) {
- this.efficiency = efficiency;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement