📄 testdates.java
字号:
import java.text.*;
import javagently.*;
import java.util.*;
import java.io.*;
class TestDates {
public static void main (String args []) throws IOException {
new TestDates ();
}
TestDates() throws IOException {
System.out.println("Type in a date as dd-mmm-yyyy");
System.out.println();
Stream in = new Stream(System.in);
String s = in.readString();
System.out.println("String is :"+s);
DateFormat DF = DateFormat.getDateInstance();
Date d = new Date();
try {
d = DF.parse(s);
System.out.println("Date is :"+d);
} catch (ParseException e) {
System.out.println("Error in date " + s);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -