From 86ea47d0025f1cdad0e95c71037d0c8ddbf3f998 Mon Sep 17 00:00:00 2001 From: JeremiasLiew Date: Wed, 5 Feb 2020 12:39:43 +0800 Subject: [PATCH 1/2] test --- src/main/java/Contacts0.java | 2 +- src/main/java/Contacts1.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/Contacts0.java b/src/main/java/Contacts0.java index 212842f..239166f 100644 --- a/src/main/java/Contacts0.java +++ b/src/main/java/Contacts0.java @@ -141,7 +141,7 @@ public static void main(String[] args) { break; } for (String m : new String[]{feedback, "==================================================="}) { - System.out.println("|| " + m); + System.out.println("|| " + m); } } } diff --git a/src/main/java/Contacts1.java b/src/main/java/Contacts1.java index 8ede41d..0bee1fa 100644 --- a/src/main/java/Contacts1.java +++ b/src/main/java/Contacts1.java @@ -678,7 +678,7 @@ private static String getUsageInfoForExitCommand() { * @return string without the sign */ private static String removePrefixSign(String s, String sign) { - return s.replace(sign, ""); + return s.replace(sign, ""); } } From 5f1e342a630d7cdaa4440e54af1b6e7ca06eec7c Mon Sep 17 00:00:00 2001 From: JeremiasLiew Date: Wed, 5 Feb 2020 13:03:48 +0800 Subject: [PATCH 2/2] test --- src/main/java/Contacts0.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/Contacts0.java b/src/main/java/Contacts0.java index 239166f..c6a0905 100644 --- a/src/main/java/Contacts0.java +++ b/src/main/java/Contacts0.java @@ -3,14 +3,13 @@ public class Contacts0 { + public static final int MAXIMUM_CAPACITY = 100; + public static void main(String[] args) { final Scanner SCANNER = new Scanner(System.in); - System.out.println("|| ==================================================="); - System.out.println("|| ==================================================="); - System.out.println("|| Contacts - Version 0.0"); - System.out.println("|| Welcome to Contacts!"); - System.out.println("|| ==================================================="); String[][] list = new String[100][3]; + displayWelcomeMessage(); + String[][] list = new String[MAXIMUM_CAPACITY][3]; int count = 0; while (true) { System.out.print("|| " + "Enter command: "); @@ -145,5 +144,13 @@ public static void main(String[] args) { } } } + + private static void displayWelcomeMessage() { + System.out.println("|| ==================================================="); + System.out.println("|| ==================================================="); + System.out.println("|| Contacts - Version 0.0"); + System.out.println("|| Welcome to Contacts!"); + System.out.println("|| ==================================================="); + } }