首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

看看这个有关问题

2012-02-25 
看看这个问题:publicvoidsort(Card[]temp){for(inti0i temp.length-1i++)for(intjtemp.length-1j i

看看这个问题:
public   void   sort(Card[]   temp){
for(int   i=0;i <temp.length-1;i++)
      for(int   j=temp.length-1;j> i;j--){
      if(temp[j].getKey() <temp[j-1].getKey())
      Card   x=temp[j];
      temp[j]=temp[j-1];
      temp[j-1]=x;
      }
}

编译出现如下错误:

casino.java:84:   不是语句
      Card   x=temp[j];
      ^
casino.java:84:   需要   '; '
      Card   x=temp[j];
              ^
2   错误
这是什么原因呀。

[解决办法]
看不出来
[解决办法]
把x定义在外面。

热点排行