1. Data types

1.1 define

Programs need to deal with a variety of data, such as text, pictures, audio, video, etc., for different data, processing methods are certainly different, data can be enough to carry out different operations. Java is a strongly typed language that provides a data type for each type of data. Different types, specify different sizes of space, the appropriate data range using the appropriate data type for storage. In order to facilitate and better processing of data, we also divide the data into different data types in the program.

1.2 classification

1.3 Basic Data types

Note: Integer values default to int values. If you need to define a variable of type long, you need to add l or L after the value if it is outside the range of int

Note: Floating point numbers are double by default. If you want to define a variable of type float, you need to add f or f after the value

Requirement: enclose characters in”

Note: Integers default to int and floating-point numbers default to double. Long integers are incremented by L or L, and single-precision floating-point numbers by F or F.