Java Data types
Boolean--true--false
BYTE--8 bits
Short--16 bit
INT--32 bits
Long--64-bit
Char
Float--32-bit
Double--64 bits
Floating point Standard i-eee-754
Cannot guarantee accuracy, deposit Money data recommended int,9.99 Yuan = 999 points, no loss of risk. You can also use a dedicated class BigDecimal
public void Int3 ()
{
int b = 0b010101_010101_111;
/* Using 0b means binary can be divided with "_" to facilitate identification */
System.out.print (b);
}
public void Boolean2 ()
{
Boolean boolean2 = true;
String str = "Hellow" +BOOLEAN2;
System.out.print (str);
/* Output Hellowtrue,boolean converted to true*/
}
Basic type automatic conversion from small to large range
Forced type conversions, ranging from large to small, with loss of precision
Data in Java can be understood using pointers, int a = 8;
Indicates that the data for the address pointed to by a pointer is 8;
In this way, most of the questions about data types can be understood
Operator
+
-
*
/
%
+=
-=
^
~
&
|
<<
>>
>>>
Can be used and understood in C language
Dead-Knock Java (2)