java中有没有检查日期格式的错误

java中有没有检查日期格式的异常
java中有没有检查日期格式的异常?

------解决方案--------------------
当然有。


public static void main(String[] args)
{
java.text.DateFormat f=new java.text.SimpleDateFormat( "yyyy-MM-dd ");
String s= "2006-01-01 ";
//String s= "222-000-d ";
try{
java.util.Date d=f.parse(s);
}catch(java.text.ParseException e)
{
System.out.println( "The input is error ");
}
}
------解决方案--------------------
有的、可以捕获
try{
java.util.Date d=f.parse(s);
}catch(java.text.ParseException e)
{
System.out.println( "The input is error ");
}