URI comparison in Java/J# / java.net.URL

Using

  <http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html#equals%28java.lang.Object%29>

in a Java (or J# :-) program

  import java.net.URL;
  
  public class UriEq
  {
      public static void main(String[] args)
      {
          try
          {
              URL uri1 = new URL("http://www.example.org/%61");
              URL uri2 = new URL("http://www.example.org/a");
              System.out.println(uri1.equals(uri2));
          }
          catch (Exception e)
          {
              System.err.println(e);
          }
      }
  }

prints "false".

Received on Thursday, 26 December 2002 14:47:34 UTC