JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
public class StringClassDemo {
public static void main(String[] args)
{
String s;
Scanner sc = new Scanner(System.in);
System.out.print("\n \t Enter String = ");
s = sc.nextLine();
System.out.print("\n\t Password is ="+ s);
String s1 = "(.*[a-z].*)";
String s2 = "(.*[A-Z].*)";
String s3 = "(.*[0-9].*)";
String s4 = "(.*[,~,!,@,#,$,%,^,&,*,(,),-,_,+,=,[,],{,},|,:,;,<,>,/,?].*)";
if(s.matches(s1) && s.matches(s2) && s.matches(s3) && s.matches(s4) && s.length() >=8 )
{
}
else
{
System.out.print("\n\t Password validation is not Correct");
Enter to Rename, Shift+Enter to Preview
OUTPUT
Uruchom