Skip to content

Instantly share code, notes, and snippets.

@aritraroy
Created April 5, 2018 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aritraroy/2dc4d4a339737ddf31ae2d48e47588ec to your computer and use it in GitHub Desktop.
Save aritraroy/2dc4d4a339737ddf31ae2d48e47588ec to your computer and use it in GitHub Desktop.
public class Order {
private String id;
private String origin;
private double price;
public Order(String id, String origin, double price) {
this.id = id;
this.origin = origin;
if (price < 0) {
this.price = 0;
} else {
this.price = price;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment