public static void main(String[] args) {
Integer stockPrice = getStockPrice();
int i = OptionalInt.ofNullable(stockPrice).orElse(0);
int j = stockPrice == null ? 0 : stockPrice;
}
static Integer getStockPrice() {
return null;
}
Comments