Java basic learning content 1 (literals, variables, constants)

What about this article?

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.

literal

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

Reserved word

A name already used in the Java language that cannot be used as an identifier (name given to a variable, class, etc.).

Basic data type

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

Java basic learning content 1 (literals, variables, constants)
Java basic learning content 7 (exception)
Java basic learning content 5 (modifier)
Java Basic Learning Content 8 (Java API)
Java basic learning content 4 (repetition)
Java basic learning content 3 (operator / ternary operator)
Java basic learning content 9 (lambda expression)
Java basic learning content 2 (array / ArrayList)
Java learning memo (basic)
[Basic knowledge of Java] Scope of variables
Java learning (0)
For JAVA learning (2018-03-16-01)
Java learning day 5
Java basic grammar
Java basic grammar
Java basic knowledge 1
[Java] Basic structure
[Java] [Basic] Glossary
Java basic grammar
Java basic grammar
Java exercises [Basic]
About Java literals
java learning day 2
java learning day 1
Java review ① (development steps, basic grammar, variables, data types)
Ruby learning points (basic)
Java learning 2 (learning calculation method)
java basic knowledge memo
Java learning memo (method)
Java Learning (1)-Hello World
[Java] Data type ①-Basic type
Java basic date manipulation
JAVA learning history interface
Java basic naming conventions
[Swift] Constants and variables
Java learning memo (interface)
Java learning memo (inheritance)
[Java] Variables and types
[Java] Basic method notes
Java basic data types
Basic Java OOps concepts