原文地址:http://leihuang.org/2014/11/18/composition-inheritance/
为什么组合优于继承?
这是一个很典型的设计模式的问题,Head First Design Pattern第一章好像就讲了,之前看得有点忘了。下面我把stackoverflow上面得分比较高的答案搬过来用一下,我觉得这样更容易理解些。
两者区别
...
分类:
其他好文 时间:
2014-11-19 00:56:51
阅读次数:
282
参考资料:http://stackoverflow.com/questions/1306778/c-virtual-pure-virtual-explained验证代码:#include using namespace std;class Base {public: virtual void ...
分类:
编程语言 时间:
2014-11-18 23:17:29
阅读次数:
196
android studio经常会莫名奇妙的找不到R文件。 1.多半是xml文件有问题,,标签不匹配等等,仔细检查。 2.如果提示的错误你已经解决,但是仍然不听的提示错误。 重启androidstutio,但是比较麻烦,stackoverflow上的解决方法是: a,选中自己的project然后按F...
分类:
移动开发 时间:
2014-11-18 17:52:39
阅读次数:
216
文章参照自:http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android#2299813像Linux这种现代操作系统的内存使用是很复杂的,因此很难准确的知道你的...
分类:
移动开发 时间:
2014-11-17 22:41:16
阅读次数:
445
1.What is the 'instanceof' operator used for?stackoverflow的一个回答:http://stackoverflow.com/questions/7313559/what-is-the-instanceof-operator-used-forins...
分类:
编程语言 时间:
2014-11-17 22:35:26
阅读次数:
428
http://www.cplusplus.com/reference/ios/ios/operator_not/http://stackoverflow.com/questions/8117566/why-istream-object-can-be-used-as-a-bool-expression...
分类:
编程语言 时间:
2014-11-17 17:17:06
阅读次数:
126
资料地址:http://stackoverflow.com/questions/6290470/eclipse-debugger-always-blocks-on-threadpoolexecutor-without-any-obvious-exceptieclpise debug 模式的线程经常会...
分类:
系统相关 时间:
2014-11-17 15:48:03
阅读次数:
433
Class类1. Class继承自Object。2. .class 和 instance.getClass()的区别Ref[1]Reference1. .classhttp://stackoverflow.com/questions/15078935/what-does-class-mean-in-...
分类:
编程语言 时间:
2014-11-17 13:52:14
阅读次数:
189
Matlab提取特征值是经常要读取多个图片文件,把文件名保存在数组中后再读取会出错。从stackoverflow中找到如下解决方法:I've a M by N matrix, each cell contains a character array, that is an image path. H...
分类:
其他好文 时间:
2014-11-16 20:03:43
阅读次数:
153
Compare Stringhttp://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-javaSupport Swith case of String?http://stackoverflow.com/question...
分类:
编程语言 时间:
2014-11-16 14:33:48
阅读次数:
177