Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - In java: What is the value range of short?
In java: What is the value range of short?
The range of SHORT is -32768~32767, and the length of SHORT is 16.

Types of Java:

boolean type

Variables with true and false values are called Boolean variables.

character type

Char type is used to represent letters, and can only represent a single letter. Usually, char constants must be enclosed in single quotation marks to distinguish them from numbers.

Char type is not very common in Java language, because if you want to store characters, you usually use the extended data type string.

Integer?

In the Java language, there are many integer data types: byte, short, int and long. They all define an integer, the only difference is that they can represent the range of data. ?

The larger the data range that can be represented, the larger the memory space occupied. Therefore, we should choose the most suitable type to define integers in programming.

Floating point type

Floating-point number, a variable data type that stores decimals. There are two types of floating-point numbers in the Java language: float and double. ?

Among them, float is a single precision type, occupying 32-bit memory space, and double is a double precision type, occupying 64-bit memory space. ?