码迷,mamicode.com
首页 > 其他好文 > 详细

reifiable type与raw type

时间:2018-06-21 17:29:28      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:ber   style   ted   com   rac   argument   with   where   arguments   

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

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

标签:ber   style   ted   com   rac   argument   with   where   arguments   

原文地址:https://www.cnblogs.com/extjs4/p/9209276.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!