Hi,
I am trying to write a password program where application accept user password but the password character can be less than 6 charcter and not more than 10 character. After the application accept the password it will ask user to type again the password in order to match the first attempt and 2nd attempt on the password. I have write down a program but it gives me illegal expression statement error. Can someone help me please ?
public class Password {
public static void main (String [] args) {
public boolean Password( String password1, String password2 )
if(!password1.equals(password2))
return false;
if(password1.length() < 6 || password1.length() > 10 )
return false;
char[] c = password1.toCharArray();
boolean numericOk = false;
boolean letterOk = false;
for(int i=0;i<c.length;i++) {
Character char = new Character(c);
if(char.isDigit() && numericOk = false)
numericOk = true;
if(char.isLetter() && letterOk = false)
letterOk = true;
if( letterOk && numericOk )
return true;
}
return false;
}