Last active
January 3, 2025 18:59
-
-
Save ru-rocker/3facf87bbfafb16a02260a31a946ed2d to your computer and use it in GitHub Desktop.
Car model for Java 8 stream example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Car { | |
private String model; | |
private String color; | |
private Double price; | |
public Car(String model, String color, Double price) { | |
this.model = model; | |
this.color = color; | |
this.price = price; | |
} | |
public String getModel() { | |
return model; | |
} | |
public void setModel(String model) { | |
this.model = model; | |
} | |
public String getColor() { | |
return color; | |
} | |
public void setColor(String color) { | |
this.color = color; | |
} | |
public Double getPrice() { | |
return price; | |
} | |
public void setPrice(Double price) { | |
this.price = price; | |
} | |
@Override | |
public String toString() { | |
return "Car (model=" + model + ", color=" + color + ")"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment