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

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. MySQL—练习2

    参考链接:https://www.cnblogs.com/edisonchou/p/3878135.html   感谢博主 https://blog.csdn.net/flycat296/articl ...

  2. Java程序中做字符串拼接时可以使用的MessageFormat.format

    Java里从来少不了字符串拼接的活,Java程序员也肯定用到过StringBuffer,StringBuilder,以及被编译器优化掉的+=.但这些都和下文要谈的无关. 比如有这样的字符串: 张三将去 ...

  3. Math类的三个方法比较: floor() ceil() round()

    public class Test { public static void main(String[] args) { double d1 = 3.4, d2 = 3.6; //正数 double ...

  4. Jenkins的多个任务并串联参数传递

    Jenkins的多个任务并串联参数传递 Parameterized Trigger Plugin插件可以使多个job连接的时候可以传递一些job相关的参数信息. 1.Parameterized Tri ...

  5. js 倒计时,转义

    function leftTimer(time) { var leftTime = (new Date(time)) - (new Date()); //计算剩余的毫秒数 var days = par ...

  6. (转载)Oracle的悲观锁和乐观锁

    为了得到最大的性能,一般数据库都有并发机制,不过带来的问题就是数据访问的冲突.为了解决这个问题,大多数数据库用的方法就是数据的锁定. 数据的锁定分为两种方法,第一种叫做悲观锁,第二种叫做乐观锁.什么叫 ...

  7. 文本相似度 余弦值相似度算法 VS L氏编辑距离(动态规划)

    设置n为字符串s的长度.("我是个小仙女") 设置m为字符串t的长度.("我不是个小仙女") 如果n等于0,返回m并退出.如果m等于0,返回n并退出.构造两个向 ...

  8. 解决 UnicodeEncodeError: 'ascii' codec can't encode characters in position 问题

    在开头加上 import sys reload(sys) sys.setdefaultencoding( "utf-8" ) Python自然调用ascii编码解码程序去处理字符流 ...

  9. GO学习笔记 - 没有条件的 switch 同 switch true 一样。

    官方教程:https://tour.go-zh.org/flowcontrol/11 没有条件的 switch 同 switch true 一样. 这一构造使得可以用更清晰的形式来编写长的 if-th ...

  10. jquery中通过trim() length 判断数据是否有值

    在jquery中可以通过如下方式判断某一个字符串是否有值,结合if else if 语句进行业务逻辑的处理 <!DOCTYPE html> <html lang="en&q ...