creating Strings from ints

I was wondering how i could create a number of strings for an int variable that i specify in an input.

For example i use

System.out.print("Number of users ");

numberOfUsers = input.nextInt();

say i specify the number of users to 5. I then want

String user1;

String user2;

String user3;

String user4;

String user5;

to be created

If i specify number of users to 2. I then only want

String user1;

String user2;

to be created

Heres the code i wish to apply it to. (its very Beta)

import java.util.*;

publicclass HelloWorld

{

publicstaticvoid main(String[] args)

{

int numberOfUsers;

String auth;

String pass;

String user1;

String pass1;

Scanner input =new Scanner(System.in);

//

System.out.print("Auth ");

auth = input.nextLine();

System.out.print("Pass ");

pass = input.nextLine();

System.out.print("Number of users ");

numberOfUsers = input.nextInt();

//

System.out.print("Username 1 ");

user1 = input.next();

System.out.print("Pass 1 ");

pass1 = input.next();

//

System.out.print("Your auth is " + auth);

}

}

Message was edited by:

FattyBank164

[1959 byte] By [FattyBank164a] at [2007-11-27 2:55:12]
# 1
for(int i=1; i<=input; i++) {System.out.println("User" +i);}
AnanSmritia at 2007-7-12 3:31:44 > top of Java-index,Java Essentials,New To Java...
# 2
You may need an array.String[] userName = new String[numOfUser];Also, it would be better to create an Object called User with properties userName, password, etc.But depends on the complexity of your application.
rym82a at 2007-7-12 3:31:44 > top of Java-index,Java Essentials,New To Java...
# 3
thanx
FattyBank164a at 2007-7-12 3:31:44 > top of Java-index,Java Essentials,New To Java...