日期:2014-05-20  浏览次数:20602 次

看看这个问题:
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定义在外面。