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.