Java核心代码例程之:CalendarDemo.java
2008-01-05 08:40:03 来源:WEB开发网核心提示:import java.util.*;/** * Demo Calendar class. ***/public class CalendarDemo{public static void main(String args[]) throws Exception{GregorianCalendar cal = new
import java.util.*;
/**
* Demo Calendar class.
***/
public class CalendarDemo
{
public static void main(String args[]) throws Exception
{
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(new Date());
System.out.PRintln((cal.get(Calendar.MONTH)+1) + "/" +
cal.get(Calendar.DAY_OF_MONTH) + "/" +
cal.get(Calendar.YEAR));
}
}
更多精彩
赞助商链接