tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Google Guava > Primitives > Long Compare

Long Compare 

Google Guava is a java library with lot of utilities and reusable components. This requires the library guava-10.0.jar to be in classpath. The following example shows using Longs.compare() API.

File Name  :  
com/bethecoder/tutorials/guava/primitive_tests/LongCompareTest.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.guava.primitive_tests;

import com.google.common.primitives.Longs;

public class LongCompareTest {

  /**
   @param args
   */
  public static void main(String[] args) {
    System.out.println(Longs.compare(6L2L));
    System.out.println(Longs.compare(2L6L));
    System.out.println(Longs.compare(4L4L));
  }
}
   

It gives the following output,
1
-1
0



 
  


  
bl  br