Java variables
A declared variable outside a class that cannot have a variable must first be declared, then assigned, before it can be used
Basic Data Type logic: Boolean (True,false) literal: char integer: Btye,short,int,long floating-point type: float,double
Reference data types: classes, interfaces, arrays
Java each integer type has a fixed table data range and field length, not affected by the specific operating system mosquito nets Call the Java language's shaping constants default to int, declaring a long constant must be added "L" AK "L" as long a=555555l;
The Java floating-point constant defaults to double, and if you want to declare a constant of type float, you must add F or F as float a=12.3f after the number;
The basic data type conversion 1.boolean type cannot be converted to another data type 2. Shaping, character-shaped, floating-point conversion capacity small automatic conversion to large capacity capacity of large size to add a forced conversion character, but it may cause precision reduction or overflow byte,short, Char does not convert to each other, in the calculation between the three, the first will automatically go to the int type, then do the operation, return to the int type, pay special attention to
Java operators
The meaning of + + (-)
+ + (-) in the previous, said to self-add or subtract, and then take the value of other things + + (-) in the after, said to take the value to do other things, done before the original value of self-added or self-reduction
int a=20;b=10;
a=b++;//after running a=10,b=11
int a=20;b=10; a=++b;//after running a=11,b=11
"+" In addition to the addition operator, or string connector, when the "+" on either side of the string, will automatically turn the other side into a string, and then a string connection
Android Development Primer (2) Java Basics