@Test public void testToday() throws ParseException { Calendar date = Calendar.getInstance(); Lunar lunar = new Lunar(date); System.out.println("今天是新历：" + chineseDateFormat.format(date.getTime())); System.out.println("农历：" + lunar.toString() + "，生肖：" + lunar.animalsYear() + "，干支：" + lunar.cyclical()); }
final public String animalsYear() { final String[] Animals = new String[]{"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}; return Animals[(year - 4) % 12]; }
Lunar { final public String animalsYear() { final String[] Animals = new String[]{"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}; return Animals[(year - 4) % 12]; } }
Lunar { final public String animalsYear() { final String[] Animals = new String[]{"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}; return Animals[(year - 4) % 12]; } Lunar();  Lunar(Date date);  Lunar(Calendar cal); }
Lunar { final public String animalsYear() { final String[] Animals = new String[]{"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}; return Animals[(year - 4) % 12]; } Lunar();  Lunar(Date date);  Lunar(Calendar cal); final String animalsYear(); final String cyclical(); Date getDate(); static String getChinaDayString(int day); String toString(); }
Lunar { final public String animalsYear() { final String[] Animals = new String[]{"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"}; return Animals[(year - 4) % 12]; } Lunar();  Lunar(Date date);  Lunar(Calendar cal); final String animalsYear(); final String cyclical(); Date getDate(); static String getChinaDayString(int day); String toString();  }