
鱼鱼桌面秀是第一款国人开发的桌面Widget(桌面漂亮小程序)软件,该软件可以逼真模拟Mac OS X Dock,可以让你的桌面变的与众不同。它采用插件机制,可以通过下载大量的Widgets部件来在你的桌面上实现诸如天气预报、世界时钟、桌面漂亮大图标、日历、便签,RSS新闻阅读和充满艺术风味的桌面书法座右铭等功能,让桌面变得更加丰富多彩。
你可以去官网看看介绍,然后下载使用:)
http://www.cfishsoft.com/?controller=fishNews&action=ShowNewsContent&articleid=48
// 封装:// 隐藏实现
// 也就是看不到这些功能是如何实现的
class Animal {
public:
virtual void eat(char* food) = 0
virtual void sleep() = 0
}
// 继承:
class Dog : public Animal {
public:
virtual void eat(char* food) {
cout <<"dog eat " <<food <<endl
}
virtual void sleep() {
cout <<"dog sleep" <<endl
}
void bark() {
cout <<"dog bark" <<endl
}
}
// 继承
class Fish : public Animal {
public:
virtual void eat(char* food) {
cout <<"fish eat " <<food <<endl
}
virtual void sleep() {
cout <<"fish sleep" <<endl
}
void swim() {
cout <<"fish swim" <<endl
}
}
// 多态:
// 表面上 dog 的类型变成了 Animal
void foo() {
Dog dog = new Dog()
Animal animal = dog
dog.eat("bone")// 正确
dog.bark()// 正确
animal.eat("bone")// 正确
animal.bark()// 编译错误
((Dog)animal).bark()// 正确
((Fish)animal).sleep()// 编译通过,运行错误
((Fish)animal).swim()// 编译通过,运行错误
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)