Regarding Java variable usage

Summary of Java variables

It outputs what you have learned about Java variables. Reference book: Introduction to Java that can be understood clearly

9 typical data types

Classification Model name Data to store frequency of use
integer byte Very small integer
short Small integer
int Ordinary integer
long Large integer
a few float A few that can be a little vague
double Ordinary decimal
Boolean value boolean true or false
letter char One character
String String Character sequence

Supplement

There is no problem if you basically use "int type" for integers. For a few, there is basically no problem if you use "double type". Enclose the characters in quotation marks. ('House') Enclose the string in double quotes. ("Let's dance at home")

Variable declaration method

 int = age;  //Variable declaration
 age = 22;  //Substitute "22" for age
 //Or
 int age = 22;  //Variable declaration and assignment in one line

 System.out.println(age);  //output

Recommended Posts

Regarding Java variable usage
java array variable
Java variable scope (scope)
java variable declaration
Java variable scope
[Java] Variable name naming memo
About Java variable declaration statements
Java exception handling usage rules
[Java11] Stream Usage Summary -Basics-
Java variable declaration, initialization, and types
JCA (Java Cryptography Architecture) Usage Memo
Java environment variable settings (Windows, AdoptOpenJDK11)
Java
Measuring instance memory usage in Java
How to write Java variable declaration
Assign evaluation result to Java variable
Java
Profiling with Java Visual VM ~ Basic usage ~
Regarding String type equivalence comparison in Java
Create variable length binary data in Java
Examine the memory usage of Java elements
[Java ~ Variable definition, type conversion ~] Study memo
[Introduction to Java] Variable declarations and types
Check heap usage with Java Flight Recorder