jdk1.5 new Features
1. Automatic box packing and automatic unpacking
Automatic boxing, the value of the base type into an object type Integer a = 2;
Automatic unpacking, the object type is changed to the basic type int b = new Integer (2); You do not need to call Intvalue int b = new Integer (2). Intvalue ();
The wrapper class has an Integer Boolean Float Double Short Byte
2. Enumeration
Java enumerations are simple and secure.
3. Generics
Generics can control the type at compile time, such as list<string> list = new arraylist<string> (), List.add () can only add string types, add other types, the compiler will error, But the bottom doesn't control him.
Type input, by reflection or by adding other object types to the
4. Variable parameters
public void method (Type ... value) {
5. Static Import
Import static Org.fkjava.oa.base.Jia.jia, you can use a class
6. Introspection
Generally we get the private property of JavaBean, which is obtained through getter and setter methods, but jdk1.5 provides a set of APIs to get JavaBean properties without the need to invoke getter and setter methods. And we don't need to care
Specific internal implementations, but we still need to understand the specific implementation. To get BeanInfo information through class Introspector. In the beaninfo to get the property descriptor Proertorydescriptor, By calling Propertorydescriptor to get the properties of the class, we know that this is done through the reflection of Java.
jdk1.7 new Features
1. Switch Support string
2.<> generics support automatic type judging list<string> List = new arraylist<> ();
3. The number can be underlined int abc = 100_33_322;
4. Support binary int aa = 0b1001_1111;
jdk1.5 new features and jdk1.7 new features