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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started