idverifier.java

来自「一个java写的加密算法」· Java 代码 · 共 33 行

JAVA
33
字号
/* * Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved. * Use is subject to license terms. */package samples.ejb.stateful.simple.tools;/** * Utility class, verifies the id of customers. */public class IdVerifier {	/**	 * Default constructor.	 */    public IdVerifier() {    }	/**	 * Validates a given id for a customer.	 * @param id  id as a string.	 * @return true if success, false otherwise.	 */    public boolean validate(String id) {       boolean result = true;       for (int i = 0; i < id.length(); i++) {         if (Character.isDigit(id.charAt(i)) == false)            result = false;       }       return result;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?