Skip to content

Instantly share code, notes, and snippets.

@jasongorman

jasongorman/Program.java Secret

Created Dec 30, 2020
Embed
What would you like to do?
public class Program {
private static StockMonitor monitor = new StockMonitor(product -> {
// We are faking this for now
System.out.println(
"You need to reorder product " + product.getId() +
". Only " + product.getStock() + " remaining in stock");
});
public static void main(String[] args) {
int productId = Integer.parseInt(args[0]);
int quantity = Integer.parseInt(args[1]);
monitor.productSold(productId, quantity);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment