Java泛型研究  被引量:3

Research on Java Generics

在线阅读下载全文

作  者:林帅[1] 林雄[2] 

机构地区:[1]四川大学软件学院,成都610207 [2]琼州大学电子信息工程学院,海南三亚572022

出  处:《电脑开发与应用》2012年第3期63-65,68,共4页Computer Development & Applications

基  金:三亚市院校专项资金项目资助课题(YD09069)

摘  要:2004年2月,Sun公司(2010年10月已被Oracle收购)在它发布的J2SE1.5版中加入了泛型,允许对类型进行抽象,程序员只需声明一个接受可变数目参数的方法,便可得到强类型在编译时刻进行类型检查的好处,简化了程序的开发。阐述了泛型基本概念和作用,介绍了在Java类、接口和方法中使用泛型的方法,通过实例比较使用泛型和不使用泛型的区别,最后指出使用泛型时要注意的问题。In February 2004,Sun released Java 2 SDK,Standard Edition Version 1.5.0 Beta 1,added generic versions allowing Abstract over types.Programmers simply define a method that accepts a variable number of arguments,then they can get benefits of type checking which simplifies program development.This article describes the basic concepts and the role of Java generics,introduces how to make use of Java generics in Java classes,Java interfaces,and Java methods,tells the difference between using Java generics programming and not using by examples.At the last,some problems which need pay attention to in the use of Java generics are summarized.

关 键 词:J2SE1.5 泛型 类型参数 

分 类 号:TP31[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象