看这段代码 Father father = new Son(); 父类引用指向子类对象,这是java的多态特性,有多态引到动态绑定,如何引入呢,看这个代码: 执行的结果是 class Son子类My name is:黄山定义的是父类引用,但是这个引用指向了堆上的子类对象Son,执行的是子类的spea
分类:
编程语言 时间:
2016-03-14 00:04:42
阅读次数:
345
#include<cstdio>#include<ctime>#include<iostream>#include<algorithm> using namespace std; int n,m,q,father[20005],x,y,r1,r2; int find(int x){ while(fa
分类:
其他好文 时间:
2016-03-12 13:19:52
阅读次数:
128
#include<cstdio>#include<ctime>#include<iostream>#include<algorithm> using namespace std; int n,m,q,father[20005],x,y,r1,r2; int find(int x){ while(fa
分类:
其他好文 时间:
2016-03-12 13:15:10
阅读次数:
107
public class Father { public void FF1(){ System.out.println("我是FF1"); } public void FF2(){ System.out.println("我是FF2"); }} public class Son extends Fa
分类:
其他好文 时间:
2016-03-11 08:54:36
阅读次数:
127
<div class="father"> <div class="son0"></div> <div class="son2"></div> <div class="son3"></div> </div> 以上面的div结构为例:使用css3中的box的一些属性可以改变框内子元素的宽 高自适应,还可
分类:
Web程序 时间:
2016-03-07 13:32:02
阅读次数:
146
单一继承多次 代码: class great_great_father { public: great_great_father() { cout << "function: \tgreat_great_father()" << std::endl; } ~great_great_father()
分类:
其他好文 时间:
2016-03-05 00:01:49
阅读次数:
261
先给出基础类资源的代码,很容易理解,不做过多介绍: 1 package oop; 2 interface t { 3 public static final String name="zhangph"; 4 } 5 public class Father implements t{ 6 privat
分类:
其他好文 时间:
2016-02-27 23:29:27
阅读次数:
293
http://blog.chinaunix.net/uid-26000296-id-3408970.html /* * \File * main.c * \Descript * father-process reads input file and sends to child-process by
分类:
系统相关 时间:
2016-02-23 14:37:00
阅读次数:
247
#include<cstdio>//https://vijos.org/p/1540 #include<cstring>#include<iostream>using namespace std;int n,m;int h[10000];int father[10000];int found(int
分类:
其他好文 时间:
2016-02-14 22:15:36
阅读次数:
172
1、对于不能确定宽度的div让它水平居中。 <div class='father'> <div class='son'>居中</div> </div> son的宽度不确定,要让它在father里面水平居中 方法: .father{text-align:center;} .son{display:in
分类:
Web程序 时间:
2016-02-03 15:32:16
阅读次数:
149