• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Test User Input Sting to Object

 
Ranch Hand
Posts: 2211
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can not get the following code to work. It never matches eventhough I know it should:

I unencrypt the password from the remote data then I test it against the user input string.

 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In this code:I can see that unEncriptedpassWord is a PasswordClass object. But what about arg1? I suspect it is a String. Am I right? If that's the case, it can never be equal to a PasswordClass object. You would have to extract a String from that PasswordClass object and compare that to arg1.
 
Ranch Hand
Posts: 56
Tomcat Server Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code below doesn't explain much about what is happening, you'd have to show the code for "PasswordClass" and there is no reference to what the arg1 object/variable is. If it an object and is not overriding the Object classes equals() method than the all that "if statement" is doing is checking if the unEncriptedpassWord object and the arg1 object are the same object.

Please provide more information reqarding the classes involved.

 
Steve Dyke
Ranch Hand
Posts: 2211
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my PasswordClass:



Here is the LogOnConnetion class that calls the PasswordClass:

 
please buy my thing and then I'll have more money:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic