J2SE 5.0 Language new features

Source: Internet
Author: User
Tags new features
J2SE  JAVATM Language Features For more information to the New Language. Generics this long-awaited enhancement to the type system allows a type or method to operate on objects of various types W Hile providing compile-time type safety. It adds Compile-time type safety to the collections Framework and eliminates the drudgery of casting. Refer to JSR 14. Enhanced for loop This new language construct eliminates the drudgery and error-proneness of iterators and index variables When iterating over collections and arrays. Refer to JSR 201. Autoboxing/unboxing This facility eliminates the drudgery of manual conversion between primitive types (such as int) and W Rapper types (such as Integer). Refer to JSR 201. Typesafe Enums This flexible object-oriented enumerated type facility allows your to create enumerated types with arbitrary Methods and fields. IT provides the benefits of the Typesafe Enum pattern ("effective Java, Item) without the verbosity and the error- Proneness. Refer to JSR 201. Varargs This facility eliminates the need for manually boxing up argument lists to an array when invoking methods Ccept variable-length argument lists. Refer to JSR 201. Static Import This facility lets your avoid qualifying static members with class names without the "Con" Stant Interface Antipattern. " Refer to JSR 201. Metadata (annotations) This language feature lets your avoid writing boilerplate code under many circumstances by enabling Tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what is done and tools should the code to D o it. Also It eliminates the need for maintaining "side files", that must is kept up to date and changes in source files. Instead The information can is maintained in the source file. Refer to JSR 175.

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.