理解继承是理解面向对象程序设计的关键。在Java中,通过keywordextends继承一个已有的类,被继承的类称为父类(超类,基类),新的类称为子类(派生类)。在Java中不同意多继承。(1)继承class Animal{ void eat(){ System.out.println("Ani.....
分类:
编程语言 时间:
2015-03-18 15:23:29
阅读次数:
149
多态中如何使用子类特有方法class Cat extends Animal{ public void eat() { System.out.println("吃鱼"); } public void catchMouse() { System.out.println("抓老鼠"); }}class.....
分类:
其他好文 时间:
2015-03-15 23:34:06
阅读次数:
154
1.类的定义及使用:样例代码:class Main{ String name; int age; String sex; String address; void eat(){ System.out.println("我会吃饭 "); } void run(){ System.out.print.....
分类:
编程语言 时间:
2015-03-13 14:03:45
阅读次数:
149
疑惑解答:1.interface接口不能够实例化(new),但是可以定义引用来指向继承该接口的实体类;如:interface animal{ void eat();}class Cat implements animal{ public void eat(){ System.out.pr...
分类:
其他好文 时间:
2015-03-08 00:01:47
阅读次数:
431
1639. Chocolate 2
Time limit: 1.0 second
Memory limit: 64 MB
Little Boy is mad at Karlsson, who ate all the sweets in the flat and even went to the neighbours to eat their sweets too. Now...
分类:
其他好文 时间:
2015-03-06 15:55:20
阅读次数:
124
atitit.提升软件开发的生产力关健点-------大型开发工具最关健
1. 可以创作出更好的工具遍历自己 1
2. 大型工具包括哪些方面 2
2.1. ide 2
2.2. dsl 2
2.3. .frmwk、、lib 2
2.4. 模块化soa 2
3. Eat Our Own Dog Food 2
4. 每样小工具只做一件事 2
5. 以command line/w...
分类:
其他好文 时间:
2015-03-05 23:49:01
阅读次数:
422
1. 面向对象 /** * Created by Administrator on 2015/2/13. */var person = { name:"mirror", age:30, eat:function(){ alert("吃货"...
分类:
其他好文 时间:
2015-02-13 13:12:22
阅读次数:
207
1. 传统编程// Person的方法- (void)eat{ NSLog(@"吃饭");}- (void)learn{ NSLog(@"学习");}- (void)play{ NSLog(@"娱乐");}// 连续做事情Person *p = [ [Person alloc] init ];...
分类:
移动开发 时间:
2015-02-10 20:16:21
阅读次数:
163
理解继承是理解面向对象程序设计的关键。在Java中,通过keywordextends继承一个已有的类,被继承的类称为父类(超类,基类),新的类称为子类(派生类)。在Java中不同意多继承。(1)继承class Animal{ void eat(){ System.out.println("Ani.....
分类:
编程语言 时间:
2015-02-08 19:24:37
阅读次数:
105
插头DP 插头dp模板题…… 这题比CDQ论文上的例题还要简单……因为不用区分左右插头(这题可以多回路,并不是一条哈密尔顿路) 硬枚举当前位置的状态就好了>_ 3 #include 4 #include 5 #include 6 #include 7 #define rep(i,n) for(...
分类:
其他好文 时间:
2015-02-04 16:20:36
阅读次数:
165