Java: matching two different type of array
- by sling
Hi,
I am doing a password login that requires me to match two array: User and Pass. If user key in "mark" and "pass", it should show successfully. However I have trouble with the String[] input = pass.getPassword(); and the matching of the two arrays.
String[] User = {"mark", "susan", "bobo"};
String[] Pass = {"pass", "word", "password"};
String[] input = pass.getPassword();
if(Pass.length == input.length && user.getText().equals(User))
{
lblstat.setForeground(Color.GREEN);
lblstat.setText("Successful");
}
else
{
lblstat.setForeground(Color.RED);
lblstat.setText("Failed");
}