reifiable type与raw type
下面的逻辑需要明白如下两个概念:
举几个是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的更多相关文章
- java泛型问题 关于警告:XX is a raw type
(本文例子适用于JDK 5.0, 学习请先安装并配置!!!) 我们从一个简单的例子开始:假设我们现在需要一个专用来存储字符串的List,该如何实现?呵呵,这还不简单,且看如下代码: ...
- 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 ...
- input[type='submit']input[type='button']button等按钮在低版本的IE下面,去掉黑色边框的问题
今天做一个tabs效果的时候,发现上面的button在低版本下会出现黑色的边框,很难看,于是我整理了下几个去掉黑色边框的办法: 1.在button的外层嵌套一个div,设置button的border: ...
- #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)宏的运行机理:1. ( (TYPE *)0 ) 将零转型为TY ...
- type和create type
type和create type 异同点: create type 可在库中生成一个长期有效的自定义类型对象,而type作用域仅限于语句块中: 两者都可以自定义数据类型: 各种ty ...
- 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/ ...
- form表单重复提交,type=“button”和type=“submit”区别
公司测试提了一个项目后台在IE浏览器下(360,firefox就没问题)出现数据重复的问题,调试了好久终于发现问题所在,也不知道是谁写的代码,醉醉的.... 错误地点: <input type= ...
- swift 中Value Type VS Class Type
ios 中Value Type 和 Class Type 有哪些异同点,这个问题是在微信的公共帐号中看到的,觉得挺有意思,这里梳理一下. 1.swift 中为什么要设置值类型? 值类型在参数传递.赋值 ...
- Failed to register Grid Infrastructure type ora.mdns.type
安装11g的集群软件的时候,在最后运行root.sh脚本时候,没有执行成功,最后提示如下错误: [root@r2 ~]# /u01/app/11.2.0/grid_1/root.sh Performi ...
随机推荐
- java并发编程实战:第十六章----Java内存模型
一.什么是内存模型,为什么要使用它 如果缺少同步,那么将会有许多因素使得线程无法立即甚至永远看到一个线程的操作结果 编译器把变量保存在本地寄存器而不是内存中 编译器中生成的指令顺序,可以与源代码中的顺 ...
- UVALive - 6434 —(思维题)
题意:给出了你由n个数组成的序列,让你将这个序列分为成m个集合,使得每一个集合的最大值减最小值的差相加最小.(如果某集合只有一个数字,则最大值减最小值为0) . 思路:首先我们不难想到,最优的分配方法 ...
- URAL 1996 Cipher Message 3 (FFT + KMP)
转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents by---cxlove 题意 :给出两个串A , B,每个串是若干个byt ...
- solr特点九:word(分词)
在Solr中配置中文分词IKAnalyzer 1.在配置文件schema.xml(位置{SOLR_HOME}/config/下),配置信息如下: <!-- IKAnalyzer 中文分词--&g ...
- 修改Tomcat的jvm的垃圾回收GC方式为CMS
修改Tomcat的jvm的垃圾回收GC方式 cp $TOMCAT_HOME/bin/catalina.sh $TOMCAT_HOME/bin/catalina.sh.bak_20170815 vi $ ...
- asp.net web 应用站点支持域账户登录
1.IIS站点应用程序池设置管道模式为classic模式,identity设置为管理员账户 2.站点验证设置,只打开windows验证,其他都关闭 3.应用程序配置web.config配置如下: &l ...
- 了解eslint
1.简介:eslint检查我们写的 JavaScript 代码是否满足指定规则的静态代码检查工具. JSHint 和 JSLint 也是静态代码检查工具,但伴随着发展,他们已经无法满足需求,于是ESl ...
- abstract方法必须在abstract类中 这句话是对的还是错的?
对 参考文章:https://zhidao.baidu.com/question/435526297.html interface中所有的方法都是抽象的,抽象类中部分方法是抽象的 实现interfac ...
- sonarLint和sonarQube
在线安装和离线装sonarLint https://blog.csdn.net/limm33/article/details/51166840 下载指定版本的sonarLint https://bin ...
- 任意模数NTT和FFT的玄学优化学习笔记
本来一直都是写\(7\)次的\(MTT\)的--然后被\(shadowice\)巨巨调教了一通之后只好去学一下\(4\)次的了-- 简单来说就是我们现在需要处理一类模数不为\(NTT\)模数的情况 这 ...