I'm programming an RPG, and I've come across having to have User-Defined objects in my constructors, and..?

I have no idea how to incorporate them...Here is an example. This is a "Weapon" constructor: public Item(String n, int p) { name = n; price = p; } public Player(String n, int l, int h, int mH, int s, int d, int sp, int e, int g, int m, int mM, int tNL,... show more I have no idea how to incorporate them...Here is an example.

This is a "Weapon" constructor:

public Item(String n, int p)
{
name = n;
price = p;
}

public Player(String n, int l, int h, int mH, int s, int d, int sp, int e, int g, int m, int mM, int tNL, ArrayList<Item> i)
{
super(n,l,h,mH,s,d,sp,e,g);
magic = m;
maxMagic = mM;
toNextLevel = tNL;
inventory = i;
}


and this is the new "Player" I want to make:

Player plr = new Player("blah",1,1,1,1,1,1,1,1,1,1,1,????... ArrayList<Item>
How would I manage that? I can't seem to find a way to do it. I would be VERY thankful if this could be figured out...
Update: I don't know how to pass in an ArrayList, or a User-Defined Object into a method OR a constructor.
2 answers 2