Android studio -Edit text Click the text you want to edit and edit it from the items in attributes on the right side of the screen.
java -When dealing with values, etc., it is necessary to clarify the type of value and put it in the type.
Type name | size | Range of values |
---|---|---|
byte | 1 byte | -128 ~ 127 |
short | 2 bytes | -32768 ~ 32767 |
int | 4 bytes | -2147483648 ~ 2147483647 |
long | 8 bytes | -9223372036854775808 ~ 9223372036854775807 |
You don't have to actively use byte or short just because the value you put in is small. You can use int for ordinary integers and long for very large numbers. Furthermore, when dealing with decimal numbers, it is necessary to use a type that represents a floating point number.
Type name | size |
---|---|
float | 4 bytes |
double | 8 bytes |
Both float and double can be used in the same way, but double can represent larger and finer numbers than float.
int x = 0.3; // This is an error double y = 0.3; // Using float and double like this Use boolean type to represent boolean value.
boolean flag = false; Use String type for strings. Note that S is a capital letter.
Also, when writing strings in source code, you must use "double quotation marks".
String message = "Hello";
·operator
operator | |
---|---|
+ | addition |
- | subtraction |
* | multiplication |
/ | division |
% | Remainder of division |
&& | Logical product (and) |
II | OR (or) |
! | Negation (not) |
< | Less than (less than) |
> | Greater (excess) |
<= | Less than |
>= | that's all |
== | equal |
!= | Not equal |
Recommended Posts