- #1
dellmac
- 4
- 0
Been working this problem for hours and can't seem to get it right. Any assistance would be greatly appreciated!
Note: Green colored text is the editable text
public class CheckingPasscodes {
public static void main (String [] args) {
boolean hasDigit = false;
String passCode = "";
int valid = 0;
passCode = "abc";
if (passCode.equals(Character.isDigit(passCode.length()))) {
hasDigit = true;
}
if (hasDigit) {
System.out.println("Has a digit.");
}
else {
System.out.println("Has no digit.");
}
return;
}
}
Note: Green colored text is the editable text
public class CheckingPasscodes {
public static void main (String [] args) {
boolean hasDigit = false;
String passCode = "";
int valid = 0;
passCode = "abc";
if (passCode.equals(Character.isDigit(passCode.length()))) {
hasDigit = true;
}
if (hasDigit) {
System.out.println("Has a digit.");
}
else {
System.out.println("Has no digit.");
}
return;
}
}