Java record-77-enhanced for loop and Automatic Disassembly box
New features in JDK5.0: Generic (Generics); Enhanced "for" loop (Enhanced For loop); Autoboxing/unboxing ); type safe enums, Static import, variable parameters, and enhanced for loop: the addition of the For-Each loop simplifies the traversal of the set. Its syntax is as follows: For (type element: array) {System. out. println (element);} when traversing a set or array, if you need to access the subscript of the set or array, use the old method to achieve loop or traversal, instead of using an enhanced for loop, it loses the subscript information. Automatic packing/unpacking greatly facilitates basic data types and their packaging functions. Automatic packing: the basic type is automatically converted to the packaging class. (Int> Integer) Automatic unpacking: The packaging class is automatically converted to the basic type. (Integer> int)