我的對象如下所示:請注意,這不是家庭作業,而是我自己正在做的Web項目。所以幫助將不勝感激!返回與數組中連續序列相匹配的第一類索引
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
}
什麼問題? – egrunin
你的「Shape」類在哪裏? – AJMansfield
「type」枚舉在哪裏? – AJMansfield