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
After studying the contents of the fourth day, you can find
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 .
Number of bytes:
Boolean Boolean 1
byte byte type 1 range -128~127
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 the default float is a double-precision floating-point double.
Automatic conversion of basic data types
Byte->short,char, int, long
Double, float
float, int
Double, long
Because the down conversion does not lose precision, the upward conversion may lose precision
This article is from the "Yehomlab" blog, make sure to keep this source http://yehom.blog.51cto.com/5159116/1772593
"DAY2" Java data type