関数の使用


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);

    }

    

}