When I relearned Java from the basics, I felt that there were many points that I had not understood so far, so I have summarized the learning contents so that I can look back on them later.
A literal is a direct representation of a value in the source code.
| type | Remarks | Example |
|---|---|---|
| Integer literal | Not only decimal numbers, but also binary numbers(0b)・ Eighth number(0)·Hexadecimal(0x)But I can write. | 10, 0b101, 0752, 0xfe |
| Floating point literal | Can write decimal numbers and exponents. | 10.0, 2e3 |
| Character literal | Express one character.\You can represent Unicode values by starting with u. | 'A', '\u0041' |
| String literal | Represent multiple strings. | "abcde" |
| Theoretical literal | Represents true or false. | true, false |
| null literal | Express that there is no reference. | null |
A name already used in the Java language that cannot be used as an identifier (name given to a variable, class, etc.).
| Mold | size |
|---|---|
| byte | 8 bits |
| short | 16 bit |
| int | 32 bit |
| long | 64-bit |
| float | 32 bit |
| double | 64-bit |
| char | 16 bit |
| boolean | 1 bit |
Recommended Posts