Imagine, if you will, a 10x10x10 cube made out of 1x1x1 bricks. Each brick must be accessable by an x,y,z coordinate. For each brick I also need to store a list of names of who own that 'brick'.
As efficiency is an absolute must, I came up with the following idea - A 3d array of vectors. note- I have made a class which stores a name, and other info (called person)
//declaration
protected Vector<person>[][][] position;
I think I must then allocate memory to the pointer position. I have tried this
position = new Vector<person>[10][10][10];
But am getting an error 'Cannot create a generic array of Vector' I am only familiar with C++ and Java is new to me. I understand java does not like declaring arrays with generic type? Does anyone know how I can get around this problem?
Cheers