The last error in the original reference resource should be:
- The Jakarta commons primitives component provides a set of container classes dedicated to saving basic types of data. Compared with using Java Collection framework and autoboxing/auto-unboxing to accomplish the same task, they have better performance.
Thanks to learner for correction.
The original "equivalent form after autoboxing" in Listing 4 is incorrect and should be:
Listing 4: equivalent form of collection Al = new arraylist () after autoboxing ();
Al. Add (
Integer. valueof (1));
During autoboxing, the constructor of the corresponding package class is not called directly, instead, use their valueof static method to obtain the new instance (the valueof method of the package classes in j2se 1.5 is enhanced, and the value of the corresponding basic type is acceptable ).
Correspondingly, the original "listing 11: autoboxing operations will happen before automatic upward transformation" should be changed:
Listing 11: The autoboxing operation will take place before the automatic upward transformation. Int I = 27828;
System. Out. println (
(Long) integer. valueof (I));/* Compilation Error */
In addition, the original "list 12: forced upward transformation is required first, and then boxing" has a written mistake, which should be changed:
Listing 12: You need to force upward transformation before making boxingint I = 27828;
System. Out. println (long)
(Long)I );