
------解决方案--------------------
鼠标指向红线,它不是告诉你是什么错误了吗,你要自己擅于发现错误,而不是一报错就发贴!
另外 DateFormat是抽象的; 无法实例化
请使用SimpleDateFormat
------解决方案--------------------
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
sdf.format(new Date());
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
sdf.format(new Date());