From 188b45ad98500452d39cff4a1c41dbbba10ac1bc Mon Sep 17 00:00:00 2001 From: Adwity Sharma <sharma78@mcmaster.ca> Date: Mon, 7 Nov 2016 17:16:43 -0500 Subject: [PATCH] Update HighScore.java - changing from static methods to non static. --- src/model/HighScore.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/model/HighScore.java b/src/model/HighScore.java index ae063d1..04e4dad 100644 --- a/src/model/HighScore.java +++ b/src/model/HighScore.java @@ -16,13 +16,13 @@ public class HighScore { ArrayList<String> arylist = new ArrayList<String>(); - static ArrayList<String> user = new ArrayList<String>(); - static ArrayList<String> score = new ArrayList<String>(); - static ArrayList<Integer> scoreInt = new ArrayList<Integer>(); + ArrayList<String> user = new ArrayList<String>(); + ArrayList<String> score = new ArrayList<String>(); + ArrayList<Integer> scoreInt = new ArrayList<Integer>(); - static int x; + int x; - public static String[] readFrom() throws IOException { + public String[] readFrom() throws IOException { String fileName = "highScore.txt"; @@ -55,7 +55,7 @@ public class HighScore { } - public static void writeTo() { + public void writeTo() { try { String filename = "highScore.txt"; @@ -74,7 +74,7 @@ public class HighScore { } } - public static void creatingArrays() throws IOException { + public void creatingArrays() throws IOException { String[] newArr = readFrom(); for (int i = 0; i < newArr.length; i++) { if (i % 2 == 0) { @@ -112,7 +112,7 @@ public class HighScore { return scoreInt.get(scoreInt.size()); } - public static boolean isHigh(int compare) { + public boolean isHigh(int compare) { if (compare > x) { return true; } else { @@ -120,7 +120,7 @@ public class HighScore { } } - public static void sortInt() { + public void sortInt() { for (int i = 0; i < scoreInt.size(); i++) { for (int j = 0; j < scoreInt.size() - 1; j++) { -- GitLab