Skip to content

Commit e76f59b

Browse files
Password
1 parent e91fcbb commit e76f59b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

PasswordStrength.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class PasswordStrength {
2+
public static void main(String[] args) {
3+
String p = "Java@123";
4+
boolean strong = p.length()>=8 &&
5+
p.matches(".*[A-Z].*") &&
6+
p.matches(".*[a-z].*") &&
7+
p.matches(".*\\d.*") &&
8+
p.matches(".*[@#$%!].*");
9+
System.out.println(strong ? "Strong Password" : "Weak Password");
10+
}
11+
}

0 commit comments

Comments
 (0)