8 Basic data types of Java
| Byte |
8bit |
2^8=256 |
-128-127 |
| Short |
16bit |
2^16=65535 |
|
| Int |
32bit |
2^32 |
|
| Long |
64bit |
2^64 |
|
| Float |
32bit |
|
|
| Double |
64bit |
|
|
| Boolean |
1 bytes or 4
|
|
|
| Char |
16bit |
|
|
If an integer is not added to any of the identifiers, the default is int, and if you need to represent the data as a long type, you need to add L to the data, not case-sensitive, and we recommend Capitalization.
If a floating-point number is not added to any identity, the default is double, and if it is required to be expressed as a float type, a decimal is followed by a f,f case-insensitive, usually lowercase.
If the Boolean represents the base type when it occupies 4 bytes, the element of the array is 1 bytes when the array is Represented.
This article is from the "rain or keep falling" blog, please be sure to keep this source http://8869176.blog.51cto.com/8859176/1866926
8 Basic data types of Java