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 ...
随机推荐
- [leetcode] 9. Binary Tree Level Order Traversal
跟第七题一样,把最后的输出顺序换一下就行... Given a binary tree, return the level order traversal of its nodes' values. ...
- Unity3d发布的iOS产品中使用GB2312字符编码(CP936)
最近在开发中要用到GB2312字符编码(CP936),在C#代码中便有了如此代码 System.Text.Encoding.GetEncoding() 这在Unity3d 编辑器下运行没有任何问题,打 ...
- scvmm sdk之ddtkh(二)
ddtkh,dynamic datacenter toolkit for hosters,原先发布在codeplex开源社区,后来被微软归档到开发者社区中,从本质上来说它是一个企业级应用的套件,集成了 ...
- DNS服务及相关概念
DNS:域名服务器:Domain Name Server IANA:互联网号码管理局:Internet Assigned Numbers Authority ICANN:互联网名称与数字地址分配机构: ...
- 朋友,请待你的朋友——BUG好一点!
程序猿嘛,难免会被BUG缠身,我相信,没有一个程序猿在被BUG缠身时是感觉轻松的,消灭BUG一定是你最大的愿望.本周,我们团队的项目进入调试阶段,各种BUG层出不穷,眼看下个周就要进行项目答辩会,所以 ...
- Delphi中MessageBox用法
消息框是个很常用的控件,属性比较多,本文列出了它的一些常用方法,及指出了它的一些应用场合. 1.最简单用法,不带图形 MessageBox(0,'不同意','提示',MB_OK); MessageBo ...
- php—Smarty-缓存1(25)
一. 缓存原理: IE:将资源文件保存至本地 Smarty:将缓存保存到服务器 编译 < 缓存 < 静 ...
- java学习笔记—第三方操作数据库包专门接收DataSource-dbutils (30)
Dbutils 操作数据第三方包.依赖数据源DataSource(DBCP|C3p0). QueryRunner – 接收DataSource|Connection,查询数据删除修改操作.返回结果. ...
- 【git】——简单用法
git 更新远程代码到本地 git fetch origin master git merge origin/master 冲突: Your local changes to the followin ...
- webpack 中文文档
webpack 最强最详细中文文档 https://doc.webpack-china.org/guides/getting-started/#- webpack多页应用架构系列 http://web ...