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 ...
随机推荐
- Hdu1429 胜利大逃亡(续) 2017-01-20 18:33 53人阅读 评论(0) 收藏
胜利大逃亡(续) Time Limit : 4000/2000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Subm ...
- handsontable-developer guide-cell editor
单元格编辑 cell editor renderer:展示数据:editor:改变数据:renderer用一个函数表示:后者有一系列的操作,需要用class来表示: EditorManager han ...
- Python学习-5.Python的变量与数据类型及字符串的分割与连接
在Python中,变量类型是固定的,一旦声明就不能修改其类型(在Python里感觉不应该用声明,而应该用使用) 正确: var = 1 print(var) var = 2 print(var) 依次 ...
- 我的Jquery参考词典
由于工作主要用到Asp.net Mvc+Jquery,最近也看了一些Jquery的书籍,在此总结以备回顾. 已读书籍:<Jquery In Action> 主要讲了些Jquery语法以及A ...
- C# autofac的一些使用
这次项目需要用autofac动态注册插件dll,插件修改或扩展后,在不重新编译的情况下能加载新的插件. 于是我们用autofac从配置文件注册.注册的文件固定named.这样不管插件怎么变,我们Res ...
- js日期转换工具
var dq = new Date();//定义当前时间var sDueDate = formatDate(dq);/调用日期转换方法 传入当前时间 //进行日期转换 function formatD ...
- html中事件调用JavaScript函数时有return与没有return的区别
JAVASCRIPT在事件中调用函数时用return返回值实际上是对window.event.returnvalue进行设置. 而该值决定了当前操作是否继续.当返回的是true时,将继续操作.当返回是 ...
- k8s rc
RC是用来管理Pod的,每个RC由一个或多个Pod组成:在RC被创建之后,系统将会保持RC中的可用Pod的个数与创建RC时定义的Pod个数一致,如果Pod个数小于定义的个数,RC会启动新的Pod,反之 ...
- ubuntu emacs的安装
在终端依次输入这三条命令即可 sudo add-apt-repository ppa:ubuntu-elisp/ppa sudo apt-get update sudo apt-get install ...
- 重新使用Eclipse建立安卓工程遇到的问题
很早之前用过Eclipse建立安卓工程,很久没用了,最近打算用Eclipse开发安卓程序,我是用谷歌提供的Eclipse集成环境建立的安卓工程,发现有了一些变化,而且遇到一点问题,这几天不断学习,终于 ...