我的对象如下所示: 请注意,这不是家庭作业,而是我自己做的一个网络项目。所以帮助将不胜感激!
enum size { small, big; }
Class Controller
{
size sizeType;
}
Class square extends shape
{
int num = 1;
}
Class circle extends shape
{
int num=2;
size size = size.Small;
}
void method()
{
Controller[] sizes = new Controller[n];
// e.g. shape = {small, big, small, small, big}
Shape circle = new Shape();
/* Find 2 'small' continuous circles
OR find 'size' based on the num value
(circle has 2 but should be able to accept
any integer = num declared in the shape class */
// RETURN occurrence of first such index for e.g. 2 as found in 2,3
}