From 4f226d8f1380c906ca290ea2051ea14d001b83d3 Mon Sep 17 00:00:00 2001 From: e0425705 Date: Fri, 28 Aug 2020 17:46:29 +0800 Subject: [PATCH] refactor --- src/main/java/Contacts0.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/Contacts0.java b/src/main/java/Contacts0.java index 212842f..9fb96e0 100644 --- a/src/main/java/Contacts0.java +++ b/src/main/java/Contacts0.java @@ -5,11 +5,7 @@ public class Contacts0 { 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("|| ==================================================="); + welcomeMessage(); String[][] list = new String[100][3]; int count = 0; while (true) { @@ -146,4 +142,12 @@ public static void main(String[] args) { } } + public static void welcomeMessage() { + System.out.println("|| ==================================================="); + System.out.println("|| ==================================================="); + System.out.println("|| Contacts - Version 0.0"); + System.out.println("|| Welcome to Contacts!"); + System.out.println("|| ==================================================="); + } + }