Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static boolean isPasswordValid(String password) { if (password.length() != 6) return false; for (int i = 0; i < password.length(); i++) { if (!Character.isDigit(password.charAt(i))) return false; } return true; } }