| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 923 人关注过本帖
标题:date类有点不明白!
取消只看楼主 加入收藏
yynn
Rank: 1
等 级:新手上路
帖 子:279
专家分:0
注 册:2005-11-4
收藏
 问题点数:0 回复次数:0 
date类有点不明白!
class Date{
    private int day;
    private int month;
    private int year;
    public Date(int d,int m,int y){
        day = d;
        month = m;
        year = y;
    }
    public int getDay(){
        return day;
    }
    public int getMonth(){
        return month;
    }
    public int year(){
        return year;
    }
    public void display(){
        System.out.println("Today is "+year+","+month+","+day);
    }
    public void succussorDate(){
        int daysInMonth[]={31,28,31,30,31,30,31,31,30,31,30,31};
        if(year%4==0&&(year%100!=0||year%400==0))
          daysInMonth[1]=29;
        if(day<daysInMonth[month])
          day++;
        else{
            day=1;
            if(month<12)
              month++;
            else{
                month=1;year++;
            }
        }
    }
    public boolean equals(){
        
    }
}
这个successordate方法是什么意思呢?
搜索更多相关主题的帖子: date 
2008-01-28 05:59
快速回复:date类有点不明白!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015605 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved