in reply to Perl and C don't always mix well
Then i realized, "Hang on! Java doesn't have eq, it only has ==" . . . So:if (foo eq "bar") . . .
And wondered for a long amount time (much longer than i care to admit) why it was always, always, always false . . .if (foo == "bar") . . .
jeffa
| Because i was comparing address spaces. The proper way to compare strings in Java is with the equals() method from the String class. |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 2: Perl and C don't always mix well
by tilly (Archbishop) on Nov 01, 2001 at 08:30 UTC |