herrDeng網內搜尋

自訂搜尋
Ads
2013年12月16日 星期一
訂閱:
張貼留言 (Atom)
熱門文章
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
-
需要練習的Java程式:
-
Ex1 加權平均
-
請用Java顯示以下字串:
-
計算gcd(123456789,999999999)
1 則留言:
package sorting;
import java.util.Arrays;
import java.util.Comparator;
class studentCA implements Comparator<Student>{
public int compare(Student X1, Student X2){
return X1.A-X2.A;
}
}
public class StudentSort {
public static void main(String[] args) {
Student X[]=new Student[3];
X[0]=new Student(0,"Mary",90 ,85);
X[1]=new Student(1,"John",59 ,65);
X[2]=new Student(2,"Joe",77 ,75);
for(int i=0; i<X.length; i++)
X[i].print();
studentCA CA=new studentCA();
Arrays.sort(X,CA);
System.out.println("=============");
for(int i=0; i<X.length; i++)
X[i].print();
}
}
張貼留言