Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Advanced-java] Odd question
- From: Pollard@xxxxxxxxx (Pollard, Jim)
- Subject: [Advanced-java] Odd question
- Date: Thu, 28 Mar 2002 17:10:26 -0600
just using str.equals("abc") is all you need to do in almost all cases where
someone would want to do this at all. in the other cases (like creating a
Parser), you'd create a String factory that returns a reference to the same
String object in every case that someone is creating a String with the same
letters.
> -----Original Message-----
> From: Alvin Wang [mailto:xwang@xxxxxxxxxxxxxxxxx]
> Sent: Thursday, March 28, 2002 4:58 PM
> To: Advanced-Java
> Subject: [Advanced-java] Odd question
> Importance: High
>
>
> Hi! It is a little odd. Let us say:
>
> String str = new String("abc");
>
> We all know that (str == "abc") is false. My question is how
> to manipulate
> str to make str point to "abc" (because str knows that its
> value itself is
> "abc"), or in the other word, to make (str == "abc") true?
>
> Thanks!
>
> _______________________________________________
> Advanced-java mailing list
> Advanced-java@xxxxxxxxxxxxxxxxxxxxxx
> http://lists.xcf.berkeley.edu/mailman/listinfo/advanced-java
>
- Prev by Date: [Advanced-java] Odd question
- Next by Date: [Advanced-java] Odd question
- Previous by thread: [Advanced-java] Odd question
- Next by thread: [Advanced-java] Odd question
- Index(es):