It's a good omen to sleep for only 6 hours, to wake up naturally and not be sleepy, and to continue studying Java.
One, 8 basic data types
Integers: Byte, short, int, long
Floating point number: float, double
Other: Char, Boolean
The first letter lowercase is the basic type, uppercase is the class (not all have the corresponding class)
As you can see, there is no string ... So I usually have to get a string of strings to use the class
Second, constant
Java uses final,c# to be const or readonly
Third, console output
Java:System.out.print ("Output")/System.out.println ("Output");
C #: Console.Write ("Output")/Console.WriteLine ("Output");
But C # still Console.readkey (), otherwise you won't see the result
Four, digital literal
The back plus L means long, and the front plus 0 means 8, and 0x means 16 binary.
float a = (float) 3.14; // The default is double, to explicitly convert double b = 3.14; float // to use the F means float
This is the same in C # (usually not noticed ...). )
Java 7 can also be int x = 1_234, equivalent to int x = 1234
On the integer, there is a pit, the default "= =" is used for -127~128,
>=128 There is no way to compare directly with = =, because this is the Java bottom design, more than 128 of the integer wrapper class is not to use the object pool, then you have to show the Intvalue () and then use = = Comparison
int a=200; int b=200; System.out.println (a//trueinteger c=200; integer d=200; System.out.println (c//false
V. Expressions, operators, assignments, self-increment/subtract (++x or x + +), comparison operators, logical operators, operator precedence, string operations
Basic and C # are consistent, note that if the right side is a complex expression, the right expression value is evaluated first with *= and/= (as in C #)
int a =n; int b = 2= A/b + 1; // 7 /= b+1; // 2 System.out.println (a);
Java Blitz Learning Day2