📄 dateexample.java
字号:
package com.redmoon.forum.test;
import java.text.*;
import java.util.*;
import java.util.Date;
public class DateExample {
public static void main(String args[]) {
// Get the Date
Date now = new Date();
// Get date formatters for default, German, and French locales
DateFormat theDate = DateFormat.getDateInstance(DateFormat.MEDIUM);
DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.MEDIUM);
DateFormat germanDate = DateFormat.getDateInstance(DateFormat.LONG, Locale.GERMANY);
DateFormat frenchDate = DateFormat.getDateInstance(DateFormat.LONG, Locale.FRANCE);
// Format and print the dates
System.out.println("Date in the default locale: " + theDate.format(now));
System.out.println("Date time in the default locale: " + dateTimeFormat.format(now));
System.out.println("Date in the German locale : " + germanDate.format(now));
System.out.println("Date in the French locale : " + frenchDate.format(now));
for (int i=32; i<150; i++) {
System.out.print((char)i);
}
System.out.println("--------------");
for (int i=160; i<384; i++) {
System.out.println((char)i);
}
String[] ary = "ddd=".split("=");
System.out.println("ary len=" + ary.length);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -