day41

接口内定义的方法,实现类内将其实现

  

1:继承:为了重写父类的代码,子类只能继承父类所有非私有的成员(成员方法与成员变量)子类不能继承父类的构造方法,但可以通过super去访问父类的构造方法。

  Thissuper的区别:this代表本类对应的引用,super代表父类存储空间的标识。

 

3:多态:(动态绑定 后期绑定 运行时绑定)

   允许不同类的对象对同一消息做出响应,即同一消息,可以根据发送对象的不同,而采用多种不同的行为方式。

多种形态:同种事物,在不同情况下的体现方式不同。

4:有明确方法返回值的调用:单独调用:没有意义   输出调用:有意义,但不够好,因为不一定非要把结果输出。  赋值调用:推荐方式

   void类型的方法调用:只能单独调用。

5:构造器:方法名与类名相同。且构造器无返回值类型, void都没有

 

明日问题的输入事件与输出事件为: | Input Events | Node Output Event description Node . e0: start program event 1 e7: Welcome message 2 e1: center a valid month 6e8: print today's date 4 e2: enter an invalid month 67| e9: print tomorrow's date 6 e3: enter a valid day 69 e10: "month OK" 39 e4: enter an invalid day 69 e11: "month out of range" 41 e5: enter a valid year 71 e12: "day OK" 4 e6: enter an invalid year 71 e13: "day out of range" 4S e14: "year OK" 54 e15: "year out of range" 5( e16: "Date OK" 6C e17: "please enter a valid date" 62 e18: "enter a month" 6( e19: "enter a day" 68 e20: "enter a year" 70 c21: "Day is month, day, year" 8S 在下表中,ASF-6对应的输入事件为: 输出事件 ASF-7对应的输入事件为: 输出事件 为:_ ASF-8对应的输入事件为:_, 输出事件 为:_ ASF-9对应的输入事件为:_,输 出事件 为:_ Atomic System Function Inputs Outputs L ASF-1 start program e0 e7 | ASF-2 enter a date with an invalid month, valid day and valid year e2, e3,e5 e11,e12,e14,e17 | ASF-3 enter a date with an invalid day, valid month and validyear| e1, c4,e5 e10,e13,e14,e17 | ASE-4 enter a date wih an ivalid year, valid day and valid monh| el,e3, c6 e10,e12, el5,e17| ASF-5 enter a date with valid month, day, and year e1,e3,e5 . e10, e12, e14, e16, c21 | ASIF-6 enter a date with valid month, day and year invalid ASF-7 enter a date with valid day, month and year invalid ASF-8 enter a date with valid year, day and month invalid ASF-9 enter a date with invalid month, day, year
06-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值