本帖最后由 夏的四季 于 2014-2-21 21:06 编辑
import java.util.*;
class CalendarDemo
{
public static void main(String[] args)
{
Calendar c = Calendar.getInstance();//创建一个默认的Calendar对象
c.add(Calendar.DAY_OF_MONTH,-1);
sop(c.get(Calendar.YEAR)+"年"+c.get(Calendar.MONTH)+"月"+c.get(Calendar.DAY_OF_MONTH)+"日"+c.get(Calendar.HOUR_OF_DAY)+":"+c.get(Calendar.MINUTE));
}
public static void sop(Object obj)
{
System.out.println(obj);
}
}
这输出语句这么长对不对?有没有简单的办法?
Calendar c = Calendar.getInstance()这句注释准确的怎么加?
|