From 0f0dd310089e760841ce22ec2ab173dac94c71d2 Mon Sep 17 00:00:00 2001 From: Michael Hunteman Date: Sun, 11 Sep 2022 15:34:45 -0500 Subject: Refactor Stock class --- picker.java | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'picker.java') diff --git a/picker.java b/picker.java index 4d12ac3..9710348 100644 --- a/picker.java +++ b/picker.java @@ -18,6 +18,7 @@ import java.lang.*; import java.util.*; +import stock.*; class Backpointer { static Stock NOTHING = new Stock(1, 0, ""); @@ -153,33 +154,3 @@ class Backpointer { System.out.println("Total value: " + totalValue); } } - -class Stock { - private int price, value; - private String ticker; - - public Stock() { - price = 0; - value = 0; - ticker = ""; - } - - public Stock(int price, int value, String ticker) { - this.price = price; - this.value = value; - this.ticker = ticker; - } - - public int getPrice() { - return price; - } - - public int getValue() { - return value; - } - - @Override - public String toString() { - return "Ticker: " + ticker + " price: " + price + " value: " + value; - } -} -- cgit v1.2.3