r/javahelp • u/BreastChaser • Jul 19 '17
Alphanumeric password input
I'd like to have an idea on how to make this program please.
It asks for an input password that meets these conditions:
-at least 6 characters long
-contains 1 capital letter or more
-alphanumeric
It denies the input if it doesn't meet those conditions, no need to hide it in asterisks.
I'm kinda new to Java and any kind of help will be appreciated
0
Upvotes
1
u/heckler82 Intermediate Brewer Jul 19 '17 edited Jul 19 '17
Look at the String and Character classes. They have all the methods you will need to accomplish this task.
Get the input, then go character by character and determine if it is an uppercase letter or a digit and then at the end, ensure both conditions were met. Regular expressions would be an easier method, but you should get the basics down first.