本文转自:http://blog.csdn.net/forevertali/article/details/4370602animal.h//在头文件中包含类的定义及类成员函数的声明class animal{public: animal(); ~animal(); void eat(); void ...
分类:
编程语言 时间:
2015-04-10 19:26:57
阅读次数:
156
多重继承常常被认为是 OOP 中一种复杂且不必要的部分。多重继承面临 crash 的场景并非难以想象,来看下面的例子。 1. 名称冲突 来看以下情况: 如果 Dog 类以及 Bird 类都有一个名为 eat() 的方法,而子类又没有 override 该方法。如果此时调用子类的 eat() 方法,编...
分类:
其他好文 时间:
2015-04-06 17:04:47
阅读次数:
176
成功的道路上,人脉比知识更重要。发展人际关系应当是你优先级最高的事。《不要一个人吃饭( Never Eat Alone)》一书介绍了21世纪的交际规则。书中包括了许多实用技巧,让你通过人际关系而兴旺发达。 保留精华,以下是从书中总结的106条技巧。在实践中练习这些技巧,变成为生活成功充实的交际大师....
分类:
其他好文 时间:
2015-04-05 11:42:45
阅读次数:
185
需要测试的类Person:
package cn.edu.lstc.junit;
public class Person {
public void run() {
System.out.println("run...");
}
public void eat() {
System.out.println("eat...");
}
public String a() ...
分类:
其他好文 时间:
2015-04-04 09:12:11
阅读次数:
110
#include #include using namespace std;class Animal{public: string mouth; void eat(); void sleep(); void drool();};class Pig : public Anima...
分类:
编程语言 时间:
2015-04-03 22:21:55
阅读次数:
166
#include class Animal{public: Animal(){}; virtual ~Animal(){}; virtual void Eat() { std::cout Eat(); getchar(); return 0;}
分类:
其他好文 时间:
2015-04-03 10:59:22
阅读次数:
118
interface State{ public void handle(StateMachine statemachine);}class Eat implements State{ StateMachine statemachine=null; public void handle(StateMa...
分类:
编程语言 时间:
2015-04-02 22:07:04
阅读次数:
167
OC语法很怪异,这与C#和java很不一样:不带参数的方法: - (void) run;带一个参数的方法:- (void)eat:(NSString *)foodName;带两个参数的方法:- (void)eat:(NSString *)foodName andWeight :(float)food...
分类:
其他好文 时间:
2015-04-01 01:49:29
阅读次数:
185
#include #include using namespace std;class Pet{public: Pet(string theName); void eat(); void sleep(); virtual void play();protected: s...
分类:
编程语言 时间:
2015-03-31 14:37:48
阅读次数:
133