Like I said before I have a 10 cell array , and each cell has 2 fields - one for Triangles and the other for Rectangles.
A rectangle defined by two points (two x,y) and triangle by three points (three x,y).
how can I define an array that each cell has two fields ,the 'x' would be of type Triangle ,the 'y' - type Rectangle.
For now I've seperated the problem into 2 different arrays ,
Quote:
public ShapeContainer() {
arrrec=new Rectangle[INIT_SIZE];
arrtri=new Triangle[INIT_SIZE];
}
I want to use one array of [10] when the 1st field (x) would be of type Triangle,and the 2nd (y) of type Rectangle.is it possible ? thank you