Java generics support in Eclipse V3.1

Source: Internet
Author: User
Tags new features

Generics in Java

Starting with almost the first version, the founders of Java technology have begun to discuss adding generics support to the language. C + + supports generics through the standard Template Library, but the implementation of generics is hampered by the lack of a unified parent class for all other classes embedded in the object class in the Java language. Generic support for the Java programming language is the most significant grammatical change in its history. For some obvious reasons, tool support is much slower than other SDK upgrades. Even so, Eclipse V3.1 has already had a great support for the new features of these languages. This article focuses on some of these new features.

Java 5 Project

To turn on Java generics support in the Eclipse V3.1, you need to install Java 5 on your machine and download it to Java 5 from a few common places. Generic support appears on the compiler Settings page along with the project properties. This means that, as before, each project has a separate SDK setting. In order to create a project that uses generics, you must specify a language level or specify a language level from the project properties of an existing project when you create the project.

The Java 5 setting uses two specific property pages. The first property page specifies the compiler settings.

Figure 1. Compiler-specific settings supported for Java 5

Unless you have set the default project settings in Eclipse for Java 5, you need to override those settings for the project. The JDK compliance zone allows you to determine the settings for source files and class files. When you set the source file to level 5, you get a lot of new content help and refactoring options.

Another related properties dialog box is the Errors/warnings area in the tree view.

Figure 2. Errors/warnings Area for project properties

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.