随笔分类 - 面向对象
摘要:炉石传说 弩炮射击(Ballista Shot)Ballista Shot弩炮射击Hero Power Deal 3 damage.英雄技能 造成3点伤害。 稳固射击(Steady Shot)Steady Shot稳固射击Hero Power Deal 2 damage.英雄技能 造成2点伤害。 实
阅读全文
摘要:https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance 解答1 Prefer composition over inheritance as it is more malleable / easy t
阅读全文
摘要:What is the difference between DAO and DAL?The Data Access Layer (DAL) is the layer of a system that exists between the business logic layer and the p...
阅读全文
摘要:http://pcedu.pconline.com.cn/empolder/gj/c/0504/609482_1.html
阅读全文
摘要:http://bbs.csdn.net/topics/220013605【18楼】打个比方,让你编一个计算正方形的程序,一般的思路是:定义3个变量,a=长,b=宽,c=a*b而面向对象的思路:先创建一个长方形的类,在类里定义两个属性分别为长、宽,再定义一个面积方法然后实例化这个类【19楼】你这样的例...
阅读全文
摘要:输出结果是 A a = new A(); B b = new B(); a.Fun2(b); 将子类B的实例b作为参数传递给父类A的引用a1。Fun2的this是父类的实例a a1.Fun1(1); 输出2 因为父类的变量a1里实际存储的是子类的实例b,所以这里调用的是子类Fun1 Fun1(5);
阅读全文