Skip to content

Commit

Permalink
Added Stock class
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikollai committed Feb 12, 2026
1 parent 9f42517 commit 1c3b918
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/main/java/Stock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import java.math.BigDecimal;
import java.util.List;

public class Stock {
String symbol;
String company;
List<BigDecimal> prices;
public Stock(String symbol, String company, List<BigDecimal> prices){
this.symbol = symbol;
this.company = company;
this.prices = prices;
}
public String getSymbol() {
return this.symbol;
}
public String getCompany() {
return this.company;
}
public BigDecimal getPrice() {
return this.prices.getLast();
}
public void addNewSalesPrice(BigDecimal price) {
this.prices.add(price);
}
}

0 comments on commit 1c3b918

Please sign in to comment.