Question: Create the method SayHello in java that takes an array of strings as a parameter. Iterate through the array and greet every element in it

Create the method SayHello in java that takes an array of strings as a parameter.
Iterate through the array and greet every element in it with "Hello" followed by a newline.
Test Case 1
In the first test case, names has the value ["Alice", "Bob"]. Running your program should produce the following output:
Hello Alice
Hello Bob
Test Case 2
In the second test case, names has the value ["1","2","3"]. Running your program should produce the following output:
Hello 1
Hello 2
Hello 3
Test Case 3
In the third test case, names has the value ["Codio"]. Running your program should produce the following output:
Hello Codio

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!