"||" checks that both conditions are true
mitchell bat wrote:getPassword returns a char[] but what to do next.
Which compiler are you using? Eclipse?Paul Clapham wrote:"Token expected" is a compiler error which says (very obscurely, I agree) that something is missing in your code. It looks like Ganesh's post is right, your brackets aren't matching up correctly.
If you know String class has a constructor which takes char[] as parameter using that you can have a String value of all those characters present in char[].
In your example here
Which compiler are you using? Eclipse?
I would have thought you probably get bracket highlighting on IntilliJ
You can use new String(myCharArray) or the toCharArray method of the String class
As I said, I think much production code uses an SHA512 or something similar to store a hash of your password
Yes you used correct constructor but I would go with advices of Stephan van Hulst and Campbell Ritchie and use char[]. You can use for practice project as Stephan van Hulst mentioned. If you are interested in knowing why prefer char[] over String for password I'll post the link of thread here which I'm going to create for that issue.mitchell bat wrote:Have I given it the right constructor?
Have you validated your assumption about what
?
1
passwordField.getPassword().toString()
returns?
[C@5c50750f
[C@62530b2c
http://www.tutorialspoint.com/java/lang/java_lang_string.htm
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|