Question: Make a class called User that stores a username and password. Implement the Comparable interface. Compare two users based on their password length. Shorter passwords
Make a class called User that stores a username and password. Implement the Comparable interface. Compare two users based on their password length. Shorter passwords come first.
If the passwords have the same length, then compare based on caseinsensitive alphabetical order of the password. If the passwords match, compare based on the caseinsensitive username.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
