comparable.java
来自「一个用Java实现的小型」· Java 代码 · 共 16 行
JAVA
16 行
/** * The <I>Comparable</I> interface allows to objects to be compared against each other. * This is useful when implementing sorting algorithms such as QuickSort. * @author Eric M. White, Information Systems Experts, Inc. */public interface Comparable { /** * @param comp The object to compare to this one. * @param type The type of comparison to make * (for example, multiple types can correspond to different fields). * @return Greater than 0 if object > this, 0 if object = this, * less than 0 if object < this */ public int compareTo(Comparable comp, String type) throws Exception;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?