Question: Create a Java program which asks the user how many names they want to enter. You may only use the keyword static once in this
Create a Java program which asks the user how many names they want to enter. You may only use the keyword static once in this program. The program should then instantiate an array that will hold this many names. The main method should call a method, getName() to allow the user to enter a name. This method should read a single name and return it. You should pass an int to this method to be used to tell the user which name they are entering. You should use a for loop in the calling code to repeatedly call this method until all of the names have been entered. Once the names are entered, the main method should call another method, displayNames(), that will use a while loop to display the names entered.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
