獲取星座的接口

private final static int[] dayArr = new int[] { 20, 19, 21, 20, 21, 22, 23, 23, 23, 24, 23, 22 };get

    private final static String[] constellationArr = new String[] { "摩羯座", "水瓶座", "雙魚座", "白羊座", "金牛座", "雙子座", "巨蟹座", "獅子座", "處女座", "天秤座", "天蠍座", "射手座", "摩羯座" };io

    @SuppressWarnings("deprecation")
    public static String getName(Date dt) {
        int month = dt.getMonth();
        int day = dt.getDate();
        return day < dayArr[month] ? constellationArr[month] : constellationArr[month + 1];
    }static

相關文章
相關標籤/搜索