Package java.lang

Examples of java.lang.Comparable.compareTo()


    //this will generate a ClassCastException if x1 is of the wrong
    //type.
    Comparable comparable = (Comparable)x1;
   
    //This may throw exceptions depending on the implementation of x1.
    return comparable.compareTo( x2 );
  }

  /**
   * @param o Object you propose to compare with this comparator
   * @return Whether o is a non-null <code>Comparable</code>
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.