• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

范型JAVA

发布: 2007-7-01 20:40 | 作者: admin | 来源: | 查看: 15次 | 进入软件测试论坛讨论

领测软件测试网

GJ is an extension of the Java programming language that supports generic types.

  • Support for generics. Many data types are generic over some other data type, and this is especially common for reusable libraries such as collection classes. GJ supports the use of such types, for instance allowing one to write the GJ type Vector<String> as opposed to the Java type Vector. With GJ, fewer casts are required, and the compiler catches more errors.

  • Superset of the Java programming language. Every Java source program is still legal and retains the same meaning in GJ. The GJ compiler can be used as a Java compiler.

  • Compiles into the Java Virtual Machine. GJ compiles into JVM code, so GJ programs run on any Java platform, including Java compliant browsers. Class files produced by the GJ compiler can be freely mixed with those produced by other Java compilers.

  • Compatible with existing libraries. One can call any Java library function from GJ, and any GJ library function from Java. Further, where it is sensible, one can assign GJ types to existing Java libraries. For instance, the GJ type Vector<String> is implemented by the Java library type Vector.

  • Efficient translation. GJ is translated by erasure: no information about type parameters is maintained at run-time. This means GJ code is pretty much identical to Java code for the same purpose, and equally efficient.

  • Freely available and fully documented. The GJ compiler is itself written in GJ, so it runs on any platform that supports Java. The GJ compiler is available for , and there is extensive .

  • Related work. There are several attempts to add generic types to Java, including our previous work on . GJ differs from these in that it places a premium on compatibility with old Java programs, which is important to developers that want to evolve smoothly from Java to GJ.

GJ was designed by of JavaSoft, of the University of South Australia, of JavaSoft, and of Bell Labs, Lucent Technologies. Although JavaSoft employees contributed to its design, GJ is not a product of JavaSoft or Sun Microsystems and neither JavaSoft nor Sun Microsystems makes any claims regarding it.


Sun has put forward a proposal to as part of the . GJ is one of the leading proposals being considered. The process is spearheaded by Gilad Bracha, one of the GJ designers.

Sun maintains a where users can vote to give feedback on which shortcomings in Java they would like to see fixed. A request to add generics to Java is bug number , and is in .

(You need to register with Sun´s to follow the above links.)


延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网