How do I put/access data stored to/from a object?
I'm trying to make a very simple game so I made an object array to store information about the the players like so:
player[] p = new player[4];
then put the player objects into the array like so:
for(int i = 0; i < 4; i++)
{
p[i] = new player();
}
the above should create an array with 4 elements with a player object in each.
now... is where I get lost. is this the syntax for putting data members into a object?
player() = {name, turn, rolledNumber}
// String name, boolean turn, int rolledNumber
//got this off wiki probably not a safe bet, but after searching for hours on the Oracle Tutorial site and other java tutorial sites I came up empty handed. I have seen this done with arrays so maybe I thought it would be similar in some aspects.
sorry if this is a empty headed question, I'm just beginning to learn java as a hobby.