The Constructor Date(String) is Deprecated since of JDK 1.1 you should not use it

来源:互联网 发布:window 命令启动软件 编辑:程序博客网 时间:2024/05/16 07:11

The Constructor Date(String) is Deprecated since of JDK 1.1 you should not use it

You should use java.text.SimpleDateFormat to convert String value to Date. E.g.

1private static final SimpleDateFormat sdf = new SimpleDateFormat(”yyyy-MM-dd”);
2String birthDate = “1981-12-30?;
3Date birth = sdf.format(birthDate);

原创粉丝点击