继承:面向对象的三大特征之一:是类和类之间的一种拓展关系,是一种从一般到特殊的关系;格式: sub extends Super, 我们把sub称为子类或者拓展类, 把super称为父类或者基类(超类)泛化:把子类中的共性抽取到父类的过程;特化:子类在父类的基础之上,拓展自己特有的状态和特征;Obje...
分类:
编程语言 时间:
2014-07-28 23:51:34
阅读次数:
367
package ObjectIntOutputStreamDemo;
import java.io.Serializable;//注意每个类都要有这个接口
public class Student implements Serializable {
private int id;
public Student(int id, String name) {
super();
this....
分类:
其他好文 时间:
2014-07-28 15:56:53
阅读次数:
246
class A extends Exception{ A(){ super(); } A(String msg){ super(msg); }}class B extends A{ B(){ super(); } B(String msg){ ...
分类:
编程语言 时间:
2014-07-28 14:48:03
阅读次数:
234
class Parent{ int num = 8;// ->3 Parent(){ //super(); // ->2 //显示初始化 // ->3 //构造代码段 // ->4 show(); // ->5 } {// ->4 ...
分类:
编程语言 时间:
2014-07-28 14:46:13
阅读次数:
182
public class Test{ public static void main(String[] args){ Child child = new Child(); }}class Parent{ public Parent(){ super(); sho...
分类:
编程语言 时间:
2014-07-28 14:44:53
阅读次数:
199
cocos2dx-lua function.lua 定义了class方法,让lua实现继承像传统语言一样漂亮和方便看定义function class(classname, super) local superType = type(super) local cls --如果父类既不...
分类:
其他好文 时间:
2014-07-28 14:27:13
阅读次数:
254
publicclassTCPServerFsimplementsRunnable{
privateSockets;
publicTCPServerFs(Sockets){
super();
this.s=s;
}
@Override
publicvoidrun(){
//TODOAuto-generatedmethodstub
//读取文件名
try{
InputStreamin=s.getInputStream();
//读取上传的文..
分类:
其他好文 时间:
2014-07-28 00:38:19
阅读次数:
155
class Demo extends Thread{ public Demo(String name){ super(name); } public void run(){ for(int i=0; i<6; ++i){ System.out.println("i...
分类:
编程语言 时间:
2014-07-27 23:10:19
阅读次数:
248
匿名内部类:
1 没有名字的内部类
前提: 必须继承 或者 实现 某个接口!
2 匿名内部类:
创建格式:
方法一:
new Super(){
//override super function()
}.fun();
方法二:
Super s = new Super(){
// override super functi...
分类:
编程语言 时间:
2014-07-27 11:38:05
阅读次数:
282
hdu 1087 Super Jumping! Jumping! Jumping!(dp 最长上升子序列和)...
分类:
其他好文 时间:
2014-07-27 11:32:02
阅读次数:
201