代码搜索:comparable
找到约 1,342 项符合「comparable」的源代码
代码结果 1,342
www.eeworm.com/read/382796/9000129
java mergesort.java
/* 递归描述的合并排序算法 */
public class MergeSort {
public static void mergeSort(Comparable a[],int left,int right)
{
Comparable[] b=new Comparable[a.length];
if (left
www.eeworm.com/read/382796/9000131
java element.java
public class Element implements Comparable
{
float w;
int i;
public Element(float ww, int ii)
{
w=ww;
i=ii;
}
public int compareTo(Object x)
{
float xw=((Element)x).w;
www.eeworm.com/read/281848/9129709
java ex29.java
// holding/Ex29.java
// TIJ4 Chapter Holding, Exercise 29, page 427
/* Fill a PriorityQueue (using offer()) with Double values created using
* java.util.Random, then remove the elements using poll
www.eeworm.com/read/281848/9129734
java ex11(4).java
// containers/Ex11.java
// TIJ4 Chapter Containers, Exercise 11, page 829
/* Create a class that contains an Integer that is initialized
* to a value between 0 and 100 using java.util.Random. Impl
www.eeworm.com/read/377523/9272872
java comptype.java
//: c09:CompType.java
// From 'Thinking in Java, 2nd ed.' by Bruce Eckel
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
// Implementing Comparable in a class.
import com.bruceeckel.
www.eeworm.com/read/377523/9272962
java mpair.java
//: c09:MPair.java
// From 'Thinking in Java, 2nd ed.' by Bruce Eckel
// www.BruceEckel.com. See copyright notice in CopyRight.txt.
// A Map implemented with ArrayLists.
import java.util.*;
pub
www.eeworm.com/read/373369/9461120
java hijackedinterface.java
//: generics/HijackedInterface.java
// {CompileTimeError} (Won't compile)
class Cat extends ComparablePet implements Comparable{
// Error: Comparable cannot be inherited with
// differe
www.eeworm.com/read/373369/9461205
java restrictedcomparablepets.java
//: generics/RestrictedComparablePets.java
class Hamster extends ComparablePet
implements Comparable {
public int compareTo(ComparablePet arg) { return 0; }
}
// Or just:
www.eeworm.com/read/373369/9461232
java comparablepet.java
//: generics/ComparablePet.java
public class ComparablePet
implements Comparable {
public int compareTo(ComparablePet arg) { return 0; }
} ///:~