摘要: In C++ marking a member function const means it may be called on const instances. Java does not have an equivalent to this把一个类到成员函数标记为const表示它只能被const的实例调用class Foo {public: void bar(); void foo() const;};void test(const Foo& i) { i.foo(); //fine i.bar(); //error}In Java the final keyword ca... 阅读全文
posted @ 2014-03-13 17:04 crowinhell 阅读(1990) 评论(0) 推荐(0) 编辑