0%
0 / 11 answered

String Manipulation Practice Test

11 Questions
Question
1 / 11
Q1

Password Validator: What will be the output if the string is "Abc1-Def"?


String password = input;

password = password.replace("-", "");

boolean longEnough = password.length() >= 8;

boolean hasDigit = password.indexOf("1") >= 0;

System.out.println(longEnough && hasDigit);

Question Navigator