java 好像新增加了对C++中模板相似功能的支持,那一位高手可以解释一下

darkstar 2002-03-31 04:35:44
generic programing
...全文
53 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
darkstar 2002-04-01
  • 打赏
  • 举报
回复
应该很快就会支持了,请看
http://developer.java.sun.com/developer/earlyAccess/adding_generics/

Prototype for JSR014: Adding Generics to the JavaTM Programming Language v. 1.2
This is a prototype implementation of a JavaTM compiler that supports generics as described in the public review draft specification. Included are the sources for a prototype compiler written in the extended language, a jar file containing the class files for running and bootstrapping the compiler, and a jar file containing stubs for the collection classes. By placing the collections jar file on the compiler's bootstrap class path, you can compile code that uses the generic collection classes documented in the public review draft. The compiler produces class files that can be run on standard (1.3 or later) Java platform. We also provide a sample script that you can use to invoke the compiler.
Disclaimer - This prototype is experimental code developed as part of JSR014 and made available to the developer community for use as-is. It is not a supported product. Use it at your own risk. The specification, language and implementation are subject to change as a result of your feedback. Because these features have not yet been approved for addition to the Java language, there is no schedule for their inclusion in a product.
Download Prototype for JSR014
README

Comments to: jsr14-prototype-comments@sun.com
Related Links
JSR 014: Adding Generics to the JavaTM Programming Language
Public review draft for JSR014
News and updates on the specification and prototype.
Comments on the specification or prototype? Tell us.
zfluo 2002-04-01
  • 打赏
  • 举报
回复
java可以通过Object来达到generic program的目的,
国外已经有人做了一个可以让java支持模版的编译器,
程序员杂志曾经有一篇对其进行过介绍
masterz 2002-03-31
  • 打赏
  • 举报
回复
Java does not support it at present.

javastd: What's the status of generic type support?

Scott Seligman: Since generics support involves significant changes to the language, it's not allowed into a dot-dot release. There's great interest in having this support both within Sun and outside, so I would expect that you'll see it in the next major release (1.5).
http://developer.java.sun.com/developer/community/chat/JavaLive/2002/jl0312.html

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧