Skip to content

Commit

Permalink
Adding single value constructor to Stock
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Mar 5, 2026
1 parent e2450da commit 2e2217b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/millions/Stock.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public Stock(String symbol, String company, List<BigDecimal> prices) {
this.prices = prices;
}

public Stock(String symbol, String company, BigDecimal initialPrice) {
this.symbol = symbol;
this.company = company;
this.prices = List.of(initialPrice);
}

public String getSymbol() {
return this.symbol;
}
Expand Down

0 comments on commit 2e2217b

Please sign in to comment.