aboutsummaryrefslogtreecommitdiff
path: root/stock
diff options
context:
space:
mode:
authorMichael Hunteman <michael@michaelted.xyz>2022-09-11 15:34:45 -0500
committerMichael Hunteman <michael@huntm.net>2023-03-07 11:06:52 -0600
commit0f0dd310089e760841ce22ec2ab173dac94c71d2 (patch)
tree3c9d995ad2ceef669cdc0bec12a9a0089e6d5740 /stock
parent800fc1664c94fd543151adf25bb2ce2e5a2f6c21 (diff)
Refactor Stock classHEADmaster
Diffstat (limited to 'stock')
-rw-r--r--stock/Stock.classbin0 -> 1166 bytes
-rw-r--r--stock/Stock.java35
2 files changed, 35 insertions, 0 deletions
diff --git a/stock/Stock.class b/stock/Stock.class
new file mode 100644
index 0000000..e26d04e
--- /dev/null
+++ b/stock/Stock.class
Binary files differ
diff --git a/stock/Stock.java b/stock/Stock.java
new file mode 100644
index 0000000..a3d97c5
--- /dev/null
+++ b/stock/Stock.java
@@ -0,0 +1,35 @@
+package stock;
+
+public class Stock {
+ int price, value;
+ 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;
+ }
+
+ public String getTicker() {
+ return ticker;
+ }
+
+ @Override
+ public String toString() {
+ return "Ticker: " + ticker + " price: " + price + " value: " + value;
+ }
+}