I. Preface
First of all to clarify the context of learning, in the second chapter of the Basic Java language Learning, first introduced the basic knowledge of what are the categories, and then introduced down. From keywords, identifiers, constants, variables, this is introduced. Here, the previous analysis is not accurate, the source code is not by the keyword, identifier composition, but the classification of the standard has a lot. From a different point of view, there will be a difference in results. If you look at the context of the knowledge point in the second chapter, the source program consists of so many parts, keywords, identifiers, constants and variables, functions, arrays .... But if you look at the source code from the initial point of view, it is a two-part, instruction and data. From different points of entry, the source program is divided, in fact, these two pointcuts are coincident, so in the introduction of variables this piece introduces the data type of knowledge points, does not conflict.
Two. Detailed analysis of variable type division
We see the data types are divided very much, it seems very complex, very troublesome, but the early sub-fine, for the subsequent operation is also beneficial, the same type of processing, no error, will not occupy the extra space, the overall efficiency will be improved.
Three. Analysis of different data types
Data types fall into two main categories: basic data types and reference data types. The reference data type is not explained first, and the basic data type is now described in detail.
The basic data types are divided into three categories: numeric, character (not string?). ), Boolean. From the perspective of the explanation, in addition to focus on the type of division, there is a memory space occupancy problems and the range of values.
Numeric types are divided into integer and floating-point types. The integer type is also divided into Byte, short, int, long. I always feel that there are three points in the learning process of the type Knowledge point: The partition of type, the size of memory space, the range of the binary. According to this idea, a description of the integer type, the first type has four kinds, byte, short, int, long, occupy the space size is one byte, two bytes, four bytes, eight bytes. The range of values is -128~127, more than 30,000, hundreds of billions, and astronomical figures. Floating-point types are divided into two single-and double-precision spaces, which are four bytes and eight bytes, and the range of values is not delved into. integers are commonly used int, decimals are commonly used double.
The character type has the necessity of discussing, there are some meanings inside. We all know that characters and strings are two concepts. Here is the character type, then the single quotation mark "is used. The explanation is ' 12 ' is not a character type, this is not very understanding?
The Boolean type does not do too much explaining.
It is also important to emphasize that eight of the basic data types are keywords, which also shows that the concepts are cross-cutting.
Java-Preliminary Understanding-Chapter II-Variable continuation