Ok, I know C/C++ really well, but just started Java today and am having an issue. I have an assignment where I have to ask the user how many names he wants to enter, and then have him enter all of the names. After all of the names have been entered, they have to be printed back out. I am not worried about the printing part, but I am worried about how to store all of these names. So far I have,
import java.io.*;
public class Problem2
{
private static BufferedReader stdin = new BufferedReader( new InputStreamReader( System.in ) );
public static void main(String[] arguments) throws IOException
{
System.out.println("Welcome. How many names do you wish to enter?");
String input = stdin.readLine();
int nameCount = Integer.parseInt(input);
for(int i = 0; i < nameCount; i++)
{
System.out.print("Enter name: ");
//NEED HELP HERE
}
}
}
Thanks for any help you can provide!