调用时直接 new IDCard().verify(身份证id);就可以了 实现代码如下: public class IDCard { private String _codeError; //wi =2(n-1)(mod 11) final int[] wi = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1}; // verify digit final int[] vi = {1, 0, 'X', 9, 8, 7, 6, 5,