Skip to content

Refactor HelloApp to use a message variable#4

Open
HarryDebugs wants to merge 1 commit intomainfrom
feature/UC4-display-multiple-names
Open

Refactor HelloApp to use a message variable#4
HarryDebugs wants to merge 1 commit intomainfrom
feature/UC4-display-multiple-names

Conversation

@HarryDebugs
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 28, 2026 04:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 message variable 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.

Comment on lines +7 to +8
String names = String.join(", ", args);
message = "Hello, " + names + "!";
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

if (args.length > 0) {
System.out.println("Hello, " + args[0] + "!");

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants