Java SE 5 new features __java

Source: Internet
Author: User
Tags wrapper java se

Release Date: April 2004

New features

(1), loop for (type Variable:array) {body} (2), generic list<type> arrayList =
New Arraylist<type> ();
Arraylist.get (i) (3), automatic box unboxing int n = 10; Boxed Integer wrapper = n;   unboxing int n = wrapper; (4), variable parameter list
Method (Other params, Type ... args)

(5), static imports of the import static Java.lang.Math;
Import static Java.lang.System;
...
Out.println (sqrt (PI));
(6)   The StringBuilder class JDK 5.0 introduces the StringBuilder class, which does not have synchronization, making the analogy StringBuffer class more efficient. (7) Meta data: annatations

The so-called JDK1.5 new feature metadata is annotations in Java is a kind of annotation java.lang.annotation.*

Instead of XML, the role of XML in the program is to replace it

The so-called metadata is a data element, a small unit, and sometimes the XML in the program will be very large, bad operation. So annotations was born. It can be said that annotations is to split the XML into a number of units, so as to achieve the same function as XML.

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.