摘要:
The only operators that can't be overloaded are the operators forscope resolution (::),member selection (.), andmember selection through a pointer to a function(.*).Almost all operators can be overloaded in C++: + - * / % ^ & | ~ ... 阅读全文
posted @ 2013-03-25 14:03
macemers
阅读(285)
评论(0)
推荐(0)
摘要:
面试题很喜欢问的题目。找了一些资料,发现两者只有以下区别: 1.In absence of anaccess-specifierfor a base class, public is assumed when the derived class is declaredstructand privat... 阅读全文
posted @ 2013-03-25 13:48
macemers
阅读(280)
评论(0)
推荐(0)
摘要:
Java里的Clone, 顾名思义就是克隆一个类的对象。克隆的方法分为浅拷贝(shallow copy)和深拷贝(deep copy)。Clone的默认方法是shallow copy,考虑以下情况: 1. 对象中所有数据域都属于基本类型,并无对其它对象的引用 2. 原始对象和浅拷贝得到的克隆对象所引... 阅读全文
posted @ 2013-03-25 12:21
macemers
阅读(964)
评论(0)
推荐(0)

浙公网安备 33010602011771号