怎么判断身份证号码是否输入正确
package com.mr;
import java.util.Scanner;
public class StringTest {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner input = new Scanner(System.in);
System.out.println("请输入身份证号码:");
String id = input.next();
String year = id.substring(6,10);
String month = id.substring(10,12);
String day = id.substring(12,14);
System.out.println("生日:"+year+"年"+month+"月"+day+"日");
}
}