W3C home > Mailing lists > Public > www-archive@w3.org > December 2002

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

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 26 Dec 2002 20:47:53 +0100
To: www-archive@w3.org
Message-ID: <3e135c57.346830025@smtp.bjoern.hoehrmann.de>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:24 GMT