The following statements about data types and packaging classes in the Java language are correct (B)

The following statements about data types and packaging classes in the Java language are correct ()

A. The basic (simple) data type is a short form of the packaging class, which can be used to replace the basic (simple) data type
. B. Both long and double occupy 64-bit (64-bit) storage space.
C. The default integer data type is int, and the default floating point data type is float.
D. Like the packaging class, the variable declared by the basic (simple) data type also has static methods to complete the conversion of hexadecimals, etc.

Analysis:
B
A, X packaging and basic types are not the same concept
B, 1, integer type byte (1 byte) short (2 bytes) int (4 bytes) long (8 bytes)
2, Character type char (2 bytes)
3. Floating point type float (4 bytes) double (8 bytes)
Both long and double occupy 64 bits (64bit) of storage space.
The default floating-point data type of C, X is double. If you want to specify the use of float, you need to add f
D at the end. The basic data type of X has no static methods, but there are wrapper classes for basic data types.

Guess you like

Origin blog.csdn.net/weixin_44436675/article/details/112976240