1: Decimal, octal (starting with 0, except 0), Hex (starting with 0x or 0X) 2:
Data type |
Memory space (8 bits 1 bytes) |
Range of values |
Byte |
8 Guests |
-128~127 |
Short |
16 Guests |
-32768~32767 |
Int |
32 Guests |
-2^31~2^31-1 |
Long |
64 guests |
-2^63~2^63-1, suffix +l/l |
Float |
32 Guests |
With a decimal part, suffix +f/f |
Double |
64 guests |
With a small number of parts, can be +d/d |
Char |
16 Guests |
' Single quote '--unicode table code: One by one corresponds to |0X0000~0XFFFF value |
3: ' Escape character \+ ... '--single quote--can represent characters or other watchmaking meanings 4:boolean:true/ False-----------------------------------implicit conversion int-long-float-double display conversion (type) _____________________________________ _5: operator
Operator |
Binding nature |
[ ] . () (Method call) |
From left to right |
! ~ + +--+ (unary operation)-(unary operation) |
From right to left |
* / % |
From left to right |
+ - |
From left to right |
<< >> >>> (unsigned Right shift) |
From left to right |
< <= > >= instanceof Comparison |
From left to right |
== != |
From left to right |
& |
From left to right |
^ |
From left to right |
| |
From left to right |
&& |
From left to right |
|| |
From left to right |
? True:false |
From right to left |
= + = = *=/=%= &= |= ^= <<= >>= >>= |
From right to left |
6: Control Flow if () {--------}else if () {-------}else{--------}switch () {case A:-----; Break;default:--------;} while () {-----};d o{----}while (), for (a;b;c) {---------}
Java data type + operator + control flow