import java.io.*;
import java.util.Scanner;
class Password{
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
public Password(String name){
public boolean check(){
boolean letter = false, number = false;
for(int i = 0; i < name.length(); i++){
if(name.charAt(i) >= '0' && name.charAt(i) <= '9')
number = true;
else if((name.charAt(i) >= 'a' && name.charAt(i) <= 'z') || (name.charAt(i) >= 'A' && name.charAt(i) <= 'Z'))
letter = true;
return (letter && number && name.length() > 12);
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String testPassword;
System.out.println("Input your password: ");
testPassword = sc.nextLine();
Password password = new Password(testPassword);
if(password.check()) System.out.println("Your passwrod is correct");
else System.out.println("Your password is incorrect");
import java.io.*;
import java.util.Scanner;
class Password{
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Password(String name){
this.name = name;
}
public boolean check(){
boolean letter = false, number = false;
for(int i = 0; i < name.length(); i++){
if(name.charAt(i) >= '0' && name.charAt(i) <= '9')
number = true;
else if((name.charAt(i) >= 'a' && name.charAt(i) <= 'z') || (name.charAt(i) >= 'A' && name.charAt(i) <= 'Z'))
letter = true;
}
return (letter && number && name.length() > 12);
}
}
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String testPassword;
System.out.println("Input your password: ");
testPassword = sc.nextLine();
Password password = new Password(testPassword);
if(password.check()) System.out.println("Your passwrod is correct");
else System.out.println("Your password is incorrect");
}
}