人生列车

follow on!success!

导航

函数使用部分

package exercise;

import java.util.*;

public class exercise {
    
    int year=0;       
    int month=0;        
    int day=0;
    public static void main(String[]args){
        
        exercise zhangjie = new exercise();
        

                
            Calendar c=Calendar.getInstance();//获得系统当前日期      
            zhangjie.year=c.get(Calendar.YEAR);       
            zhangjie.month=c.get(Calendar.MONTH)+1;//系统日期从0开始算起    
            zhangjie.day=c.get(Calendar.DAY_OF_MONTH);  
        //Text tianxia = new Text();
        //zhangjie.Text;
        System.out.println("year is"+zhangjie.year+"mouth is"+zhangjie.month+"day is "+zhangjie.day);
    }
    
}

 

posted on 2015-01-08 04:20  tianxia2s  阅读(135)  评论(0编辑  收藏  举报