关于Date包的问题
else if(4 == step)
{
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
Date birthday = null;
try {
birthday = (Date)sf.parse(in);
goddess.setBirthday(birthday);
System.out.println("请输入女神的【邮箱】");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("您输入的格式有误,请重新输入。");
step = 3;
}
这段代码里面birthday = (Date)sf.parse(in);抛出了异常java.util.Date cannot be cast to java.sql.Date不能强制转换,不过不强制转换又报错。。求解释