公共の 静的な 無効getWeekMonthYear(){ 地図 <文字列、整数> mapInt = 新しいのLinkedHashMap <文字列、整数> (); カレンダーカレンダー = Calendar.getInstance(); 日付今日 = 新しい日付(); calendar.setTime(今日)。// 此处可换为具体某一时间 int型平日= calendar.get(Calendar.DAY_OF_WEEKの); INT MONTHDAY = calendar.get(Calendar.DAY_OF_MONTH)。 INT yearDay = calendar.get(Calendar.DAY_OF_YEAR)。 もし(平日== 1 ){ 平日 = 7 。 } 他{ 平日 =平日- 1 。 } mapInt.put( "周" 、平日)。 mapInt.put( "月" 、MONTHDAY)。 mapInt.put( "年" 、yearDay)。 用(のMap.Entry <文字列、整数> エントリ:mapInt.entrySet()){ するSystem.out.println( "今天是本" + entry.getKey()+ "的第" + entry.getValue()+「天" ); } }