Intとintegerの違いは何ですか?



What Is Difference Between Int



Java provides two different types: reference types and prototype types (or built-in types). Int is the raw data type of Java, and integer is the wrapper class provided by Java for int. Java provides a wrapper class for each primitive type. The primitive type wrapper classes, booleanBoolean, charCharacter, byteByte, shortShort, intIn reference types and the original type behave completely differently, and they have different semantics. Reference types and primitive types have different characteristics and usages, including: size and speed issues, which type of data structure is stored by this type, when the reference type and primitive type are used as instance data for a class The default value. The default value of an object reference instance variable is null, and the default values ​​of the original type instance variables are related to their type.