I am trying to set up an array that hold objects that i am creating, however their parameters are of different types and i get an 'incompatable types error when i try to compile.
This is the code that i am using:
Object has the following parameter types: Object(int x, int y, int s, string)PHP Code:private Shape[] shape = new Shape[6];
int [] object= new Shape [6];
shape[0] = new Circle(40, 40, 30, Color.red);
shape[1] = new House(80, 80, 30, Color.yellow);
shape[2] = new Square(120, 120, 30, Color.blue);
shape[3] = new Diamond(160, 160, 30, Color.green);
shape[4] = new Face(200, 200, 30, Color.pink);
shape[5] = new Face(240, 240, 30, Color.black);
I'm new to java so its probbly a silly mistake. Can someone tell me what I'm doing wrong?
