⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.java

📁 java的经典例子
💻 JAVA
字号:
import java.text.DateFormatSymbols;import java.text.SimpleDateFormat;import java.util.*;class Main {    public static void main(String[] args) {        // Create a date formatter.         SimpleDateFormat dateformat =             new SimpleDateFormat ();         // Create an instance of DateFormatSymbols.        DateFormatSymbols dfs = new DateFormatSymbols();        // Modify the short month string to be all uppercase.        dfs.setShortMonths(new String[]                        {"JAN", "FEB", "MAR", "APR", "MAY", "JUN",                         "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"});        // Apply pattern.        dateformat.applyPattern("dd-MMM-yyyy - H:mm:ss zzzz");        // Apply the symbols to this date format.        dateformat.setDateFormatSymbols(dfs);        // Format the current time.        String dateString = dateformat.format(new Date());        System.out.println(dateString + "\n");                                         // "27-NOV-1997 - 5:44:47 GMT+01:00"        // Get and print out the first short month string.        String month = dateformat.getDateFormatSymbols().getShortMonths()[0];        System.out.println(month);       // "JAN"    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -