看看这个怎么错了???
class shape{}
class circle extends shape{}
class square extends shape{}
class triangle extends shape{}
public class shapes{
public static shape randshape(int i){
shape switch(i%3){
default:
case 0:return circle;
case 1:return square;
case 2:return triangle;
}
}
public static void main(String args[]){
shape[] s=new shape();
for(int i=0;i<s.length;i++)
s[i]=randshape[i];
}
}
错误信息是
method does not return a value