Skip to content

Instantly share code, notes, and snippets.

@ru-rocker
Last active January 3, 2025 18:59
Show Gist options
  • Save ru-rocker/3facf87bbfafb16a02260a31a946ed2d to your computer and use it in GitHub Desktop.
Save ru-rocker/3facf87bbfafb16a02260a31a946ed2d to your computer and use it in GitHub Desktop.
Car model for Java 8 stream example
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