-
Notifications
You must be signed in to change notification settings - Fork 71
Update code to improve readability #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,14 +3,13 @@ | |
|
|
||
| public class Contacts0 { | ||
|
|
||
| public static final int MAX_ENTITIES = 100; | ||
| public static final int FIELD_COUNT = 3; | ||
|
Comment on lines
+6
to
+7
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job extracting a constant |
||
|
|
||
| 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]; | ||
| printWelcomeScreen(); | ||
| String[][] list = new String[MAX_ENTITIES][FIELD_COUNT]; | ||
|
Comment on lines
+11
to
+12
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job |
||
| int count = 0; | ||
| while (true) { | ||
| System.out.print("|| " + "Enter command: "); | ||
|
|
@@ -146,4 +145,12 @@ public static void main(String[] args) { | |
| } | ||
| } | ||
|
|
||
| private static void printWelcomeScreen() { | ||
| System.out.println("|| ==================================================="); | ||
| System.out.println("|| ==================================================="); | ||
| System.out.println("|| Contacts - Version 0.0"); | ||
| System.out.println("|| Welcome to Contacts!"); | ||
| System.out.println("|| ==================================================="); | ||
| } | ||
|
|
||
|
Comment on lines
+148
to
+155
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good job refactoring code. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think a better name than MAX_ENTITIES?