public class Picture
{
private Square s1;
private Square s2;
private Square s3;
private Square s4;
private Square s5;
private Square s6;
private Square s7;
private Square s8;
private Square s9;
/**
* Constructor for objects of class Picture
*/
public Picture()
{
// nothing to do... instance variables are automatically set to null
}
/**
* Draw this picture.
*/
public void draw()
{
s1 = new Square(23,87,104,"red",true);
s2 = new Square(23,112,104,"yellow",true);
s3 = new Square(23,137,104,"magenta",true);
s4 = new Square(23,87,129,"blue",true);
s5 = new Square(23,112,129,"green",true);
s6 = new Square(23,137,129,"yellow",true);
s7 = new Square(23,87,154,"magenta",true);
s8 = new Square(23,112,154,"red",true);
s9 = new Square(23,137,154,"blue",true);
}
}
我必须为班级创建一个 rubix 立方体,但似乎无法让它工作。我不断收到错误:
cannot find symbol - constructor Square(int,int,int,java.lang.String,boolean)
有谁知道我哪里出错了?请帮忙