URI compareTo() Example
Compares this URI to another object, which must be a URI.
URIclass compareTo() method example. This example shows you how to use compareTo() method.This method Compares this URI to another object, which must be a URI.
Here is the code:-
/**
* @Program that Compares this URI to another object, which must be a URI.
* CompareTo.java
* Author:-RoseIndia Team
* Date:-23-jun-2008
*/
import java.net.*;
public class CompareTo {
public static void main(String[] args) throws Exception {
URI u = new URI("http://java.sun.com/j2se/1.3");
//Compares this URI to another object, which must be a URI.
int i = u.compareTo(new URI("http://java.sun.com/j2se/1.3"));
System.out.println(i);
}
} |
|