public class Uporabnik{ String ime, priimek, geslo; public static boolean veljavnoGeslo(String x){ boolean abeceda = false; boolean dolzina = false; int stevke=0; for(int i = 0; i=48 && v <=57) || (v >=65 && v <=90) || (v >=97 && v <=122)) abeceda = true; else return false; /*if(Character.isLetter(znak) || Character.isDigit(znak)) abeceda = true; else return false;*/ if(v >=48 && v <=57) stevke++; } if (x.length()>=10) dolzina = true; if(abeceda && dolzina && stevke>1) return true; else return false; } public Uporabnik (String uIme, String uPriimek, String uGeslo) { this.ime = uIme; this.priimek = uPriimek; if(veljavnoGeslo(uGeslo)) this.geslo = uGeslo; else this.geslo = "*"; } public static void main(String[] args){ String g1 = "abcdefghijk342"; String g2 = "abcč123efc"; System.out.println(Uporabnik.veljavnoGeslo(g1)); System.out.println(Uporabnik.veljavnoGeslo(g2)); Uporabnik u = new Uporabnik("Janez", "Novak", g2); System.out.println(u.ime + " " + u.priimek + " " + u.geslo); } }