a few of my thaughts on this subject also:

*java treats only "+" operator specially. that is if  + is applied on
 two string, it concatinates them.

*to the best of my understandsin, no other operator is "overloaded" of any
 ohter type. os a==null would never result in a.equals("null").

> An interesting side note:
>   String a = "Hello"; String b = "Hello"; // or even String b = "H" + "ello"
>   if (a == b) System.out.println("a == b");
>   if (a.equals(b)) System.out.println("a.equals(b)");
> prints both "a == b" and "a.equals(b)" using both the Sun JDK 1.2 compiler
> and jikes on Windows NT. This is part of what led me astray so long ago, and
> I re-ran the experiment today with the same result.

* you get a==b becuase, im asuming that you have decalared them in
  main(..) and hence these are static Strings and hence, the complier does
  the optimization of creating only one String object for "Hello" and
  asigning them to both variable a and b.

*You should not get a==b when
 String a="Hello";
 String b="H";
 I dont get this in with jkd1.2.2 on NT4.0, SP5.


-Aditya

And java references were sup'ozed to Aviod Pointer Confuzon ! ha ha.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to