| Author |
Problem with Array search
|
Karl Vaicek
Greenhorn
Joined: Mar 01, 2010
Posts: 11
|
|
Hello, everyone,
I'm programming socket, but my protocol doesn't work fine.. Client sends card number (xxxx xxxx xxxx xxxx) which is defined in servers protocols string array.
(that's not the whole code)
But problem is somewhere here, because if I enter corect card number (which is defined in array), i get :
>Your card is not in our database. Try again 1111 0000 1111 0000 0
I think, that my for loop is alright, but I don't understand why it's not working...
I will be grateful for your help!
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
== uses object instance equality. Use the equals method to compare your strings instead.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Karl Vaicek
Greenhorn
Joined: Mar 01, 2010
Posts: 11
|
|
|
Thank you!!!
|
 |
Karl Vaicek
Greenhorn
Joined: Mar 01, 2010
Posts: 11
|
|
Rob Prime wrote:== uses object instance equality. Use the equals method to compare your strings instead.
THANK YOU! That was so easy, but i couldn't figure it out :/
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
You're welcome.
|
 |
 |
|
|
subject: Problem with Array search
|
|
|