reifiable type与raw type

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

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;
    }
}  

  

 

  

转载于:https://www.cnblogs.com/extjs4/p/9209276.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值