Conversation
There was a problem hiding this comment.
Pull request overview
Refactors HelloApp to build the greeting message in a variable before printing, while also changing how command-line arguments are incorporated into the greeting.
Changes:
- Introduces a
messagevariable and prints it once at the end. - Builds the greeting from command-line arguments using
String.join(", ", args)when args are present.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| String names = String.join(", ", args); | ||
| message = "Hello, " + names + "!"; |
There was a problem hiding this comment.
This change alters behavior: previously only args[0] was greeted, but now all command-line arguments are joined and included in the greeting. If the PR is intended to be a pure refactor (per title), consider reverting to args[0] or updating the PR title/description to reflect the new multi-name behavior.
|
|
||
| if (args.length > 0) { | ||
| System.out.println("Hello, " + args[0] + "!"); | ||
|
|
There was a problem hiding this comment.
There's a whitespace-only blank line inside the if-block; please remove the trailing spaces (or the extra blank line) to avoid noisy diffs and keep formatting clean.
No description provided.