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

📄 main.java

📁 java的经典例子
💻 JAVA
字号:
import java.util.*;

class Main {
    public static void main(String[] args) {
//
        Calendar cal1 = Calendar.getInstance();
        Calendar cal2 = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
   
        // Make sure both calendars have identical times.
        Date date = new Date();
        cal1.setTime(date);
        cal2.setTime(date);

        // Demonstrates that calendar times are independent to the time zone.
        System.out.println(cal1.after(cal2));        // false
        System.out.println(cal2.after(cal1));        // false

        cal2.set(1000, Calendar.JANUARY, 1);
        System.out.println(cal1.after(cal2));        // true

        cal2.set(3000, Calendar.JANUARY, 1);
        System.out.println(cal1.after(cal2));        // false
//
    }
}

⌨️ 快捷键说明

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