There are 8 Java basic data types, so just remember. Except that it's all reference type.
Java four class eight basic data types First class: integer byte short int long Type II: float float double Class III: Logical Boolean (it has only two values desirable true false) Class Fourth: Character Char Data that can be allocated directly in the stack is the base data type. Reference data type: is a reference to the data in the stack, but his object is in the heap. To learn Java you must know where the various data are stored in memory. A good understanding of memory can help you to analyze the program. Bytes: Boolean Boolean 1/8 byte byte type 1 Char character type 21 characters can store a Chinese character Short Quick-Integer 2 int integer Type 4 float float type (single precision) 4 Long length shaping 8 Double dual precision type (double) 8 The default integer type in Java is type int, and if you want to define float type, add L or L to the value. The default float is also a double-precision floating point, and if you want to define float type, add F or F to the value. One byte equals 8 bits, one byte equals 256 digits, and that is 128 to 1271 altogether 256. KB is Kbytes Bytes is the meaning of "byte"! K is the meaning of thousand, because the computer is calculated by binary, 10 1 is exactly 1024 1111111111 (binary) =1024 (decimal) 1Bytes (bytes) =8bit (bits) An English letter or an Arabic numeral is a character that occupies a byte A Chinese character is two characters and occupies two bytes. Generally speaking the size is used bytes, uppercase "B", the network rate is used bit, attention is lowercase "b". Example: A file has 8MBytes Example: The rate at which I download files is 256kb/s, which is 2Mbit, which is usually the rate of our broadband Internet connection. Basic data Type Auto convert Byte->short,char, int, doubleint, floatlong, long floatRemember:small turn big, big turn little will lose precision!!! |