Collator Compare() Example

Compares its two arguments for order.


Collatorclass Compare() method example. This example shows you how to use Compare() method.This method Compares its two arguments for order.

Here is the code:-
/* 
 * @Program that Compares its two arguments for order.
 * Compare.java 
 * Author:-RoseIndia Team
 * Date:-16-Jun-2008
 */

import java.util.*;
import java.text.*;

public class Compare {

    public static void main(String[] args) {
        Collator collate = Collator.getInstance();
        Object s1="jhfdkjk";
        Object s2="jhfdkjklrejf";
        //Compares its two arguments for order.
        int i=collate.compare(s2, s1);
        System.out.println(i);
    }
}

Output of the program:-
 1

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US