extends的继续关系 page继承Dapta:也就是page拥有data的所有功能. <?php class Data{ function f(){ "; } } class Page extends Data { function ss(){ return $Data->f(); } } $DataPage = new Page; echo $DataPage->f(); ?>…
Extends jade允许多个jade文件继承一个jade文件. jade: //- layout.jade doctype html html head block title title Default title body block content //- index.jade extends ./layout.jade block title title Article Title block content h1 My Article html: 生成的index.html中 <!…
package Test2016; import java.util.ArrayList; import java.util.List; public class Test2016 { public static void main(String[] args) { List<? super Fruit> first = new ArrayList<Fruit>(); //Fruit -> Apple first.add(new Apple()); first.add(new…
原文地址:http://blog.csdn.net/fw0124/article/details/42296283 泛型中使用通配符有两种形式:子类型限定<? extends xxx>和超类型限定<? super xxx>. (1)子类型限定 下面的代码定义了一个Pair<T>类,以及Employee,Manager和President类. public class Pair<T> { private T first; private T second; p…