Why do people still use primitive types in Java?
问题 Since Java 5, we've had boxing/unboxing of primitive types so that int is wrapped to be java.lang.Integer , and so and and so forth. I see a lot of new Java projects lately (that definitely require a JRE of at least version 5, if not 6) that are using int rather than java.lang.Integer , though it's much more convenient to use the latter, as it has a few helper methods for converting to long values et al. Why do some still use primitive types in Java? Is there any tangible benefit? 回答1: In