Java日历Calendar获取实例getInstance


Java日历Calendar获取实例getInstance

package com.codingdict;

import java.util.*;

public class CalendarDemo {
   public static void main(String[] args) {

      // create a calendar    
      Calendar cal = Calendar.getInstance();

      // gets a calendar using the default time zone and locale.
      System.out.print("Date And Time Is: " + cal.getTime());
   }
}