下面的逻辑需要明白如下两个概念:  

4.7. Reifiable Types

4.8. Raw Types 

举几个是Reifiable Types的例子,如下:

class A{}
class B<T>{}
class C<T>{
    class D<X>{

    }
}

class TestType{
    public void test(){
        //It refers to a non-generic class or interface type declaration.
        A a;
        // It is a parameterized type in which all type arguments are unbounded wildcards
        B<?> b;
        // It is a primitive type
        int c;
        // It is an array type (§10.1) whose element type is reifiable.
        int[] d;
        // It is a nested type where, for each type T separated by a ".",
        // T itself is reifiable.
        C<?>.D<?> e;
        // It is a raw type
    }
}

举几个是Raw Types的例子,如下:

class A{}
class B<T>{}
class C<T>{
    class D<X>{

    }
    class E{
        T e;
    }
}

class TestType{
    public void test(){
        // A non-generic class or interface type is not a raw type.
        A a;
        // The reference type that is formed by taking the name of
         // a generic type declaration
        // without an accompanying type argument list.
        B b;
        // An array type whose element type is a raw type.
        B[] c;
        // A non-static member type of a raw type R that is not inherited
        // from a superclass or superinterface of R
        C.D d;
        C.E e;
    }
}  

  

  

reifiable type与raw type的更多相关文章

  1. java泛型问题 关于警告:XX is a raw type

    (本文例子适用于JDK 5.0, 学习请先安装并配置!!!)         我们从一个简单的例子开始:假设我们现在需要一个专用来存储字符串的List,该如何实现?呵呵,这还不简单,且看如下代码:   ...

  2. Caused by: java.lang.IllegalStateException: Expected raw type form of org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$Match

    spring 4.0.2,mybatis 3.2.6,aspectjweaver 1.8.10 使用的时候,报错: Caused by: java.lang.IllegalStateException ...

  3. input[type='submit']input[type='button']button等按钮在低版本的IE下面,去掉黑色边框的问题

    今天做一个tabs效果的时候,发现上面的button在低版本下会出现黑色的边框,很难看,于是我整理了下几个去掉黑色边框的办法: 1.在button的外层嵌套一个div,设置button的border: ...

  4. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)

    #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)宏的运行机理:1. ( (TYPE *)0 ) 将零转型为TY ...

  5. type和create type

    type和create type 异同点:      create type 可在库中生成一个长期有效的自定义类型对象,而type作用域仅限于语句块中:      两者都可以自定义数据类型: 各种ty ...

  6. There is no result type defined for type 'json' mapped with name 'success'. Did you mean 'json'?

    错误信息: 严重: Exception starting filter struts2 Unable to load configuration. - action - file:/C:/Users/ ...

  7. form表单重复提交,type=“button”和type=“submit”区别

    公司测试提了一个项目后台在IE浏览器下(360,firefox就没问题)出现数据重复的问题,调试了好久终于发现问题所在,也不知道是谁写的代码,醉醉的.... 错误地点: <input type= ...

  8. swift 中Value Type VS Class Type

    ios 中Value Type 和 Class Type 有哪些异同点,这个问题是在微信的公共帐号中看到的,觉得挺有意思,这里梳理一下. 1.swift 中为什么要设置值类型? 值类型在参数传递.赋值 ...

  9. Failed to register Grid Infrastructure type ora.mdns.type

    安装11g的集群软件的时候,在最后运行root.sh脚本时候,没有执行成功,最后提示如下错误: [root@r2 ~]# /u01/app/11.2.0/grid_1/root.sh Performi ...

随机推荐

  1. jsp request 获取路径

    这篇教程不错:http://zjutsoft.iteye.com/blog/1084260 自己试验如下: System.out.println("-----------------serv ...

  2. nginxのerror_logはformat指定できない.

    備忘録です. http://toshitanian.hatenablog.com/entry/2013/10/25/023838 2013-10-25 nginxのerror_logはformat指定 ...

  3. SqlServer 的一个坑

    以前一直以为sqlserver 在做ddl 操作的时候是锁表的,而oracle 是锁行,感觉oracle 要比sqlserver 先进一些,但是这是我的认识错误.其实sqlserver 也是可以锁行的 ...

  4. prog1,2,3

    1.第一版本程序Prog1:+ 给定一个数组,实现数组元素求和:具体要求:实现对一维数组(a[100])的所有元素相加运算.+ 数据准备:a)数组长度:100:b)数组数据来源:实验数据A列:1~10 ...

  5. Java定时任务的实现

    本例依据Java自身提供的接口实现,通过监听器(Listener)和定时器(Timer)定时执行某个任务(Task).专业的开源工具可参考Quartz:http://www.opensymphony. ...

  6. 在一般处理程序里面读写session

    1.引用命名空间 using System.Web.SessionState; 2.继承IRequiresSessionState接口 3.利用httpcontext类读写即可 context.ses ...

  7. Android 中 LayoutParams 的用法

    一个控件应当使用它的父控件的 LayoutParams 类型.因此,一个 TableVow 应该使用 TableLayout.Params . 所以,以一个 TableRow 为例: TableRow ...

  8. 2、Windows下安装配置Redis

    windows下redis软件开源安装包挂载到github上,下面将详细介绍如何在windows下安装redis服务器 下载地址:https://github.com/MSOpenTech/redis ...

  9. 决定以后再做公司的项目的时候,能够用其他语言的绝对不用delphi

    1.delphi7的IDE真的很不友好 2.delphi7的控件有的有问题 3.delphi7居然不支持结构体的泛型存储 4.网上的解决文档超少,一些小bug,就要折腾半天 5.pascal语法太过结 ...

  10. button不能添加伪类元素

    今日试了一下button添加伪类元素,结果是不行的前后都叠加在一起 html代码: <button class="form_btn" formType="submi ...