jshell> import java.text.SimpleDateFormat;
jshell> void test(){ SimpleDateFormat smf = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); String curTime = smf.format(new Date()); System.out.println(curTime); } | 已修改 方法 test()
jshell> test(); 2021-12-31 13:57:11
我和同事试了都是这样,你们也是吗, java8 编译模式和我的 java11 交互式都是这样


