It outputs what you have learned about Java variables. Reference book: Introduction to Java that can be understood clearly
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 | ◎ |
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")
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