From f9ce5bc529295696c841afc7c17c5b61083a8082 Mon Sep 17 00:00:00 2001 From: mo Date: Tue, 18 Jun 2019 16:44:53 -0600 Subject: try to create a testable API using constructor injection --- src/Q4/RandomSumGame.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Q4/RandomSumGame.java') diff --git a/src/Q4/RandomSumGame.java b/src/Q4/RandomSumGame.java index e5b6ce0..7976288 100644 --- a/src/Q4/RandomSumGame.java +++ b/src/Q4/RandomSumGame.java @@ -1,5 +1,6 @@ package Q4; +import java.io.*; import java.util.*; public class RandomSumGame { @@ -9,6 +10,11 @@ public class RandomSumGame { private int sum; private int valuePoint; private String status; + private PrintStream out; + + public RandomSumGame(PrintStream out) { + this.out = out; + } public void play(int d1, int d2) {} -- cgit v1.2.3