Http://blog.chinaunix.net/uid-26642637-id-3235815.html
String is not a basic data type in Java. There are 8 basic data types in Java, all of which have encapsulated classes (wrapper classes), where the wrapper class of the base data type char is somewhat special and is the character class.
Java is a strongly typed language, which means that you must declare a type for each variable. In Java, there are 8 basic data types (primitive type), with 4 integers, 2 floating-point types, 1 character-type char for character cells that represent Unicode encoding, and a Boolean type to represent truth values. These underlying types are also called raw data types, which are value-passing rather than reference-passing when data is passed.
(1). Java provides four integral types:
Int |
4 bytes |
Short |
2 bytes |
Long |
8 bytes |
Byte |
1 bytes |
In Java, the scope of an integral type is independent of the machine running Java, which is related only to Java virtual machines.
(2). Java provides two floating-point types:
Float |
4 bytes |
Double |
8 bytes |
All floating-point numeric computations follow the IEEE754 specification. The following are three special floating-point values used to indicate overflow and error conditions:
Positive Infinity: double.positive_infinity
Negative Infinity: double.negative_infinity
Nan:double. NaN (not a number)
For example: A positive integer processing divided by 0 is positive infinity, and the square root of 0/0 or minus numbers is calculated as Nan.
(3). Java-Char
In Java, a unit of code described by a char type in UTF-16 encoding. It is strongly recommended that you do not use the char type in your program. Unless you are sure you want to manipulate the UTF-16 code unit. It is best to represent the strings that need to be processed in an abstract data type.
(4). Boolean type
A Boolean type has two values: false and True to determine the logical condition. The integral type and the Boolean value cannot be exchanged directly.