From f4b3c5142f7112a4680e3e52b39df12b09e9dd9f Mon Sep 17 00:00:00 2001 From: jiaaaqi Date: Fri, 28 Aug 2020 17:40:48 +0800 Subject: [PATCH] refracted welcome message --- src/main/java/Contacts0.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/Contacts0.java b/src/main/java/Contacts0.java index 212842f..3b2c763 100644 --- a/src/main/java/Contacts0.java +++ b/src/main/java/Contacts0.java @@ -3,14 +3,12 @@ public class Contacts0 { + public static final int MAX_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]; + showWelcomeScreen(); + String[][] list = new String[MAX_CAPACITY][3]; int count = 0; while (true) { System.out.print("|| " + "Enter command: "); @@ -146,4 +144,12 @@ public static void main(String[] args) { } } + private static void showWelcomeScreen() { + System.out.println("|| ==================================================="); + System.out.println("|| ==================================================="); + System.out.println("|| Contacts - Version 0.0"); + System.out.println("|| Welcome to Contacts!"); + System.out.println("|| ==================================================="); + } + }