Java basic data types

I summarized the basic data types of Java.

Data type list

type Mold Bit number range Description
Integer type byte 8 bits -128 ~ 127
short 16 bit -32768 ~ 32767
int 32 bit -2147483648 ~ 2147483647 It is also possible to express it in other than decimal notation using the following prefix.
・ Binary number ⇒ 0b ~
・ Eighth number ⇒ 0 ~
・ Hexadecimal ⇒ 0x ~
long 64-bit -9223372036854775808 ~ 9223372036854775807 Add "L" at the end when writing explicitly
Floating point type float 32 bit ±1.40239846×10^-45~±3.40282347×10^38 When explicitly stated, add "f" or "F" at the end
double 64-bit ±4.94065645841246544×10^-324~±1.79769313486231570×10^308
Logical type boolean - true or false
Character type char - Can be written below
-Unicode characters \ u0000- \ uFFFF
・ Integer value 0~65535
・ Single quotation('')1 character enclosed in

Recommended Posts

Java basic data types
Basic data types and reference types (Java)
[Java] Data type ①-Basic type
Java Learning 1 (learning various data types)
Java review ① (development steps, basic grammar, variables, data types)
About Java basic data types and reference type memory
[Java] Basic types and instruction notes
[Java] Exception types and basic processing
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 data types (especially primitive types) and literals
java basic knowledge memo
Java basic date manipulation
Java basic naming conventions
Java learning memo (basic)
[Java] Variables and types
[Java] Basic method notes
Basic Java OOps concepts
Java basic learning content 7 (exception)
Basic Authentication with Java 11 HttpClient
Java basic syntax + α trap
Java learning memo (data type)
Basic data type and reference type
[Java] Basic statement for beginners
Java programming (variables and data)
Java basic learning content 5 (modifier)
About Java class loader types
Importing Excel data in Java 2
I investigated Java primitive types
[Java] Thymeleaf Basic (Spring Boot)
Implement Basic authentication in Java
Import Excel data in Java
Java addition excel data validation
Java for beginners, data hiding
Java Basic Learning Content 8 (Java API)
[Beginner] Java basic "array" description
List data structure [Java / Scala]
Java basic learning content 4 (repetition)
[Java] Basic terms in programming
Java variable declaration, initialization, and types
[Introduction to Java] Variables and types (variable declaration, initialization, data type)
Java basic learning content 3 (operator / ternary operator)
Java primitive types, reference types, Immutable, Mutable
Java basic learning content 9 (lambda expression)
[Java] Data type / matrix product (AOJ ⑧ Matrix product)
Basic usage of java Optional Part 1
Java array variables are reference types
Java basic learning content 2 (array / ArrayList)
[Java] Runtime Data Areas of JVM
About Java primitive types and reference types
List of types added in Java 9
[Basic knowledge of Java] Scope of variables
Basic structure of Java source code