好几天没来学习了,昨晚把继承的又整理了一下。想把整理后的东西发到hexo博客上来,却发现命令行又失效了。前几天明明是好的,这几天又没有进行任何操作,网上搜了一下也没有招到合适的解决办法,无奈只能重装了。小白就是要折腾,下面贴上继承的第一个学习笔记

How to design the inheritance tree

1.Look for objects that have common attributions and behaviors.
2.Design a class that represents the common state and behavior.
3.Decide if a subclass needs behaviors(method implementations) that are specific to that particular subclass type.
4.Look for more opportunities to use abstraction, by finding two or more subclass that might need common behavior.

4 designing principles

1.DO use inheritance when one class is 大专栏  Inheritance Learning Notea more specific type of a superclass .
2.DO consider inheritance when you have behavior(implemented code) that should be shared among multiple classes of the same general type.
3.DO NOT use inheritance just so that you can reuse code from another class, if the relationship between the superclass and subclass violate either of the above two rules.
4.DO NOT use inheritance if the subclass and superclass do not pass the IS-A test.

Rules for overriding

The method are the contract

1.Arguments must be the same, and return types must be compatible.
2.The method can’t be less accessible.

Rules for overloading

1.The return types can be different.
2.you can’t change ONLY the return type.
3.You can vary the access levels in any direction.

坚持
Runbo

Inheritance Learning Note的更多相关文章

  1. Learning note for Binding and validation

    Summary of my learning note for WPF Binding Binding to DataSet. when we want to add new record, we s ...

  2. Learning Note: SQL Server VS Oracle–Database architecture

     http://www.sqlpanda.com/2013/07/learning-note-sql-server-vs.html This is my learning note base on t ...

  3. Course Machine Learning Note

    Machine Learning Note Introduction Introduction What is Machine Learning? Two definitions of Machine ...

  4. shell learning note

      shell learning note MAIN="/usr/local/" # 变量大写 STATUS="$MAIN/status" # 美元符加字符串是 ...

  5. 2014/09/30 Learning Note

    Vbird Linux: Vim Learning: http://linux.vbird.org/linux_basic/0310vi.php Bash Shell: http://linux.vb ...

  6. [Angular2] @Ngrx/store and @Ngrx/effects learning note

    Just sharing the learning experience related to @ngrx/store and @ngrx/effects. In my personal opinio ...

  7. Machine Learning Note Phase 1( Done!)

    Machine Learning 这是第一份机器学习笔记,创建于2019年7月26日,完成于2019年8月2日. 该笔记包括如下部分: 引言(Introduction) 单变量线性回归(Linear ...

  8. Machine Learning Note

    [Andrew Ng NIPS2016演讲]<Nuts and Bolts of Applying Deep Learning (Andrew Ng) 中文详解:https://mp.weixi ...

  9. Java: some learning note for Java calssloader and Servlet

    1. Java Classloader 链接: https://en.wikipedia.org/wiki/Java_Classloader 摘要: The Java Classloader is a ...

随机推荐

  1. Python笔记_第二篇_面向过程_第二部分_5.第三方模块的使用和自定模块(以Pillow模块为例)

    1. 安装第三方模块: 打开黑屏终端: cmd: pip -verson pip - V C:\windows\system32>pip -V pip from c:\python37\lib\ ...

  2. Teensy-HID攻击

    title date tags layut 渗透利器-Teensy(低配版BadUSB) 2018-09-25 kali post 准备工作 一块 Teensy2.0++ 的板子(淘宝一搜就有) Ar ...

  3. $.proxy和$.extend

    $.proxy用法详解 参考:https://www.cnblogs.com/alice626/p/6004864.html jQuery中的$.proxy官方描述为: 描述:接受一个函数,然后返回一 ...

  4. redis day02 下

    位图:是二进制数据(0101101010)2^32 强势点: 01_login :101110(比如:第一天登录,二天没登录) 传统的字符串解决方案中 记录用户登录日期  统计堪忧 01_login_ ...

  5. FastJson禁用循环引用检测

    我们先来看一个例子: package com.elong.bms; import java.io.OutputStream; import java.util.HashMap; import java ...

  6. Linux_切换,创建,和删除目录

    切换目录 cd /tmp cd ..切换到上一个目录 cd ~  进入当前用户的家目录 cd ~nbzyh  进入zyh用户 创建目录 当当前在tmp中时:mkdir /tmp/sam 这里用的是绝对 ...

  7. 26)PHP,数据库表格中项的数据类型

    类型展示: tinyint-----1个字节 smallint----2个字节 mediumint--3个字节 int------4个字节 bigint---8个字节 字符串类型 最基本最重要的2个: ...

  8. EmailService

    package me.zhengjie.tools.service; import me.zhengjie.tools.domain.EmailConfig; import me.zhengjie.t ...

  9. Eclipse中配置使用本地schema或dtd文件

    问题:在设备不能正常联网的情况下,无法获取到网络上的 dtd 或 schema,编写配置文件的 XML 文档就没有了提示功能. 一般情况下,下载的 Jar 包或者 Zip 包中都会包含需要的 sche ...

  10. 郑宇以城市计算研究膺选 MIT 科技创新35俊杰 (TR35)

    MIT 科技创新35俊杰 (TR35)"> 编者按:<MIT Technology Review>于8月22日发布了令人瞩目的2013年全球杰出青年创新者(MIT TR35 ...