在这行(m = new mnmn(22, 9, 2001);)下加入: m.display();

解决方案 »

  1.   

    public class mnmn {
        private int day = 12;
        private int month = 6;
        private int year = 1900;
        
        public mnmn(int d, int m, int y) {
             year = y;
                 month = m;
                 day = d;
    }    
        
        
        public static void main(String[] args) {
                  mnmn  m;
          m = new mnmn(22, 9, 2001);
      m.display();     //  增加的
    }    
      
    public void display() {

            System.out.println(year + " / " + month + " / " +day);  
    }
    }