为什么类Search中的Search1不能引用类FindLarge中的Find

bingo8489 2004-12-15 10:49:59
1 public class FindLarge extends Tower{
2 int x,y,z,num;
3
4 public int Find(int b[][][],int c){
5 int a=0;
6 int d=0;
7 for (int x=0;x<=b.length-1;x++) {
8 if (b[x][c-1][0]==1) {
9 a = b[x][c-1][1];
10 break;11 }
12 }
13
14 for (int x=0;x<=b.length-1;x++) {
15 if ((b[x][c-1][0]==1) && (b[x][c-1][1]>= a )){
16 a = b[x][c-1][1];
17 d = x;
18 }
19 }
20 return d;
21 }
22
23 }
24
25 class Search extends FindLarge{
26 int large,position;
27
28 public void search1( int a,int b[][][]){
29 int c,d;
30
31 for (int x=0;x<=b.length-1;x++) {
32 if (b[a][x][0]==1) {
33 position = x;
34 break;
35 }
36 for (int y=0;y<=b.length-1;y++) {
37 if (b[a][y][0]==1) {
38 continue;
39 }
40 c =super.Find(b[a][y][1],(y+1));
41 }
42
43 }
44 }
45}
...全文
57 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
bingo8489 2004-12-15
  • 打赏
  • 举报
回复
谢谢指点!!
break后面是误打上去了
^_^
EverythingMaster 2004-12-15
  • 打赏
  • 举报
回复
c =super.Find(b[a][y][1],(y+1));
这条语句不对。
b[a][y][1]是int,而不是期望的int三维数组。
这样可以:
c =super.Find(b,(y+1));
tom2005 2004-12-15
  • 打赏
  • 举报
回复
你写的 有问题吧

10 break;11 }
这一行是什么

4 public int Find(int b[][][],int c){
这个是数组

c =super.Find(b[a][y][1],(y+1));
这个为int


62,629

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧