public static void getCount()
{
System.out.println("How Many Players? ");
int a = inputCount.nextInt();
while(a <2 || a > 8)
{
System.out.println("How Many Players? ");
a = inputCount.nextInt();
}
count = a;
}
public static void addPlayers(int count)
{
Object[] playerStats = null;
for (int i = 1;i <= count; i++)
{
System.out.println("Enter Name: ");
String a = inputName.nextLine();
name = a;
int balance = 1500;
int positon = 0;
playerStats = new Object[]{i, name, balance, positon};
}
}
In this scenario I am wanting to create a player name from the user input, I then want to add this name as well as balance and position into an object.
My issue is I am not entirely sure how I am going to both access this object outside the for loop and use them on a unique basis, as more than one will be created at a time, only with different names.
Thanks and please be gentle, I'm very new to this.
EDIT: Thanks for the responses guys, I'll try out these ideas.