1.虚方法 virtual 重写 override 父类中的方法,在子类中并不适用,那么子类需要自主更改继承的方法或者是属性,那父类中加了virtual关键字的方法才可以被子类重写,子类重写父类的方法使用的是override关键字 例: 我们都知道,喜鹊(Magpie).老鹰(Eagle).企鹅(Penguin)都是属于鸟类,我们可以根据这三者的共有特性提取出鸟类(Bird)做为父类,喜鹊喜欢吃虫子,老鹰喜欢吃肉,企鹅喜欢吃鱼. 创建基类Bird如下,添加一个虚方法Eat(): /// <sum…
2016年11月27日 星期日 --出埃及记 Exodus 20:18 When the people saw the thunder and lightning and heard the trumpet and saw the mountain in smoke, they trembled with fear. They stayed at a distance 众百姓见雷轰,闪电,角声,山上冒烟,就都发颤,远远地站立.…
面对对象就是:把数据及对数据的操作方法放在一起,作为一个相互依存的整体——对象.对同类对象抽象出其共性,形成类.类中的大多数数据,只能用本类的方法进行处理.类通过一个简单的外部接口与外界发生关系,对象与对象之间通过消息进行通信.程序流程由用户在使用中决定.       封装:将客观事物抽象成类,每个类对自身的数据和方法实行 继承:广义的继承有三种实现形式: 实现继承(指使用基类的属性和方法而无需额外编码的能力). 可视继承(子窗体使用父窗体的外观和实现代码). 接口继承(仅使用属性和方法,实现滞…
socket网络编程 socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄,应用程序通常通过"套接字"向网络发出请求或者应答网络请求. socket起源于Unix,而Unix/Linux基本哲学之一就是“一切皆文件”,对于文件用打开.读写.关闭模式来操作.socket就是该模式的一个实现,socket即是一种特殊的文件,一些socket函数就是对其进行的操作(读/写IO.打开.关闭) socket和file的区别: file模块是针对某个指定…
2016年12月27日 星期二 --出埃及记 Exodus 21:22 "If men who are fighting hit a pregnant woman and she gives birth prematurely but there is no serious injury, the offender must be fined whatever the woman's husband demands and the court allows. 人若彼此争斗,伤害有孕的妇人,甚至坠…
2016年11月30日 星期三 --出埃及记 Exodus 20:21 The people remained at a distance, while Moses approached the thick darkness where God was.于是百姓远远地站立,摩西就挨近 神所在的幽暗之中.…
2016年11月29日 星期二 --出埃及记 Exodus 20:20 Moses said to the people, "Do not be afraid. God has come to test you, so that the fear of God will be with you to keep you from sinning." 摩西对百姓说,不要惧怕,因为 神降临是要试验你们,叫你们时常敬畏他,不致犯罪.…
2016年11月28日 星期一 --出埃及记 Exodus 20:19 and said to Moses, "Speak to us yourself and we will listen. But do not have God speak to us or we will die."对摩西说,求你和我们说话,我们必听,不要 神和我们说话,恐怕我们死亡.…
2016年11月26日 星期六 --出埃及记 Exodus 20:17 "You shall not covet your neighbor's house. You shall not covet your neighbor's wife, or his manservant or maidservant, his ox or donkey, or anything that belongs to your neighbor." 不可贪恋人的房屋,也不可贪恋人的妻子,仆婢,牛驴,并他…
2016年11月25日 星期五 --出埃及记 Exodus 20:16 "You shall not give false testimony against your neighbor.不可作假见证陷害人.…