//Eight basic data types in Java, one reference data type string, remember to use double quotes//Although in Java, integers do not have any adornments, the default is an int constant, and the floating-point number does not have any adornments that represent a double type constant//However, the following direct assignment is not a problem, because when the Java compiler compiles, will determine whether the current constant is in the range of data type variables, if so, do not error//when computing data types in Java, the default is to convert to int, and when there are larger than int type, a long is converted to a large data type, and floating-point is converted to double//in Java, the conversion of data types, small data types to large data types, is automatically converted. While large data types are converted to small errors, the accuracy is lost. To cast//In a cast, is a bitwise conversion, int i = n; byte B = (byte) i; //-128, directly take the position, not only the maximum is 127, save 128 is the 127//The stored values in the computer are binary complementary forms of storage, positive number of the original code, anti-code, complement the same//Negative Inverse code: the original code based on the symbol bit unchanged, the remaining bits 0 for 1, 1 for 0. //negative complement: On the basis of the inverse code +1//so through the complement can be anti-roll out the original code, so you can calculate the number beyond the data type, not only can save 127, you save 128 will be 127
Java Data types