• Post Reply Bookmark Topic Watch Topic
  • New Topic

Searching Arrays

 
Gezelle Ealey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting error message that the symbol cannot be found for array values in the search.
 
Les Morgan
Rancher
Posts: 717
17
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use String.equals(String) for comparisons of Strings because "==" requires that the Objects be the same Object, not just contain the same value.
 
Paul Clapham
Sheriff
Posts: 21869
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't really understand your code. You're comparing entries in the arrays to two different things, and both have to be equal. But you only have one ID field and one password field -- shouldn't you be comparing the contents of those things to your array entries?

And also you're comparing the array entries (in the wrong way, as Les already said) to variables which I don't see declarations for anywhere. Is your mysterious error message perhaps referring to those variables?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!