码迷,mamicode.com
首页 >  
搜索关键字:animal    ( 988个结果
HDU 4302 线段树单点更新,维护区间最大最小值
http://acm.hdu.edu.cn/showproblem.php?pid=4302 Problem Description Holedox is a small animal which can be considered as one point. It lives in a straight pipe whose length is L. Holedox can on...
分类:其他好文   时间:2015-01-20 22:14:50    阅读次数:194
js面向对象之继承-原型继承
//animal 父类 超类 var Animal = function(name) { this.name = name; this.sayhello = function() { ...
分类:Web程序   时间:2015-01-18 18:32:55    阅读次数:237
J2SE快速进阶——向上转型及其内存分析
我们都知道,狗是动物中的一种,那么如果现在有一个Dog类和Animal类,那么他们的关系就是Dog类继承Animal类。 我们经常说,狗是动物,实际上“狗是动物”这句话就是向上转型的一个例子,即把狗(子类)当做动物(父类)来看待。用一句话来总结,向上转型就是父类的引用指向子类的实例。 当父类的引用指向子类对象的时候,父类的引用只可以访问子类继承于父类的那一部分属性和方法以及子类重写的父类的方法。...
分类:其他好文   时间:2015-01-18 00:56:07    阅读次数:209
第十七节(is-a 、is-like-a 、has-a,包和 import )
is - a 类与类之间的继承关系; is - like - a 类与接口之间的关系; has - a 关联关系;public class Animal{ public void method01();}// 类与类之间的关系class Dog extends Animal{ //...
分类:其他好文   时间:2015-01-17 17:48:18    阅读次数:120
【c++程序】复杂抽象结构
#include using namespace std; class Animal { public: Animal(int); virtual ~Animal(){cout<<"析构动物"<<endl;} virtual int GetAge(){return itsage;} virtual void Sleep()=0; virtual void Propagate()=0; ...
分类:编程语言   时间:2015-01-14 22:58:27    阅读次数:257
【HDOJ】2440 Watch out the Animal
刚开始学随机算法,凸包+模拟退火。 1 /* 2440 */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 #define M...
分类:其他好文   时间:2015-01-07 12:38:08    阅读次数:129
参数列表调用子类构造函数
有时候,基类构造函数是带有参数,而子类构造函数是不带参数的,如下:class Animal{public: Animal(int width, int height) { this->width = width; this->height = height; }private: int ...
分类:其他好文   时间:2015-01-02 15:56:50    阅读次数:169
java中的多态
多 态(面向对象特征之一):方法本身就具备多态性,某一种事物有不同的具体的体现。体现:父类引用或者接口的引用指向了自己的子类对象。//Animal a = new Cat();多态的好处:提高了程序的扩展性。多态的弊端:当父类引用指向子类对象时,虽然提高了扩展性,但是只能访问父类中具备的方法,不可以...
分类:编程语言   时间:2014-12-31 14:18:34    阅读次数:183
oracle取分组的前N条数据
select * from(select animal,age,id,row_number()over(partition by animal order by age desc) row_numfrom zoo)where row_num <=5;http://bbs.csdn.net/topic...
分类:数据库   时间:2014-12-31 10:00:04    阅读次数:172
Javascript面向对象编程(二):构造函数的继承 by 阮一峰
今天要介绍的是,对象之间的"继承"的五种方法。比如,现在有一个"动物"对象的构造函数。 function Animal(){ this.species = "动物"; }还有一个"猫"对象的构造函数。 function Cat(name,color){ this.name = na...
分类:编程语言   时间:2014-12-29 15:04:16    阅读次数:224
988条   上一页 1 ... 85 86 87 88 89 ... 99 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!