20145321 "Java Program design" The 2nd week study Summary textbook Learning content Summary
Type, variable, operator
1. Type (basic type)
(1) Integers: Short (2 bytes), int (accounting for 4 bytes), Long (8 bytes) three kinds. The greater the number of integers, the larger the integer range that can be represented by the integer type.
(2) Byte: Byte type (1 bytes). An integer that represents the -128~127 when used to represent an integer.
(3) floating point number: Mainly used to store decimals, divided into float (4 bytes), double (8 bytes).
(4) Character: char type (2 bytes), used to store character symbols such as ' Z '.
(5) Boolean: Boolean type, which represents true and false.
(6) Annotation://single-line annotation;/**/multiline annotation.
2. Variables
(1) If you want to declare what type of variable, use int, byte and other keywords to declare. Do not start with a number, and do not use special characters. Named by: "Hump-type" nomenclature, such as "int ageofstudent".
(2) Final: Declare a variable with final qualification to prevent yourself or others from inadvertently modifying it.
(3) Ignore symbol \: If you want to represent only one character, add this character after \, such as \ '.
(3) 0b means binary, 0 means octal, and 0x means 16 in. When you represent a longer number, the underscore is used to make the expression clearer. such as int a=1234_5678.
3. Operators
(1) Arithmetic operations: +,%, etc.
(2) comparison, conditional operation:>, = = (judgment, and = is the specified operation), 1? 2:3 ET
(3) Logical Operation:&&, | |,!
(4) Bitwise arithmetic:&, |, ~ (sense should be anti-code), ^ (XOR), <<, >>, >>>
(5) Increment decrement operation: i++ 、--I, etc.
(6) Specify operation: + =,/=, etc.
Second, type conversion
Note that when you write a program, type conversions, such as 3.14, are default to double, and you need to add f:3.14f after you want to define float. If different types are included in an expression, the operation is dominated by the longest type.
Third, Process Control
1. Branch: If...else;switch...case
2. Circulation: For;while;do...while;break\continue
Problems in teaching materials learning and the solving process
1, what is the difference between printf and println, when using to distinguish? Another printf ("0 and 0%5d%n", 0 & 1), feel the comma after the content and C language slightly different, after the code to feel more.
2, the specified operation does not know whether to learn C language ignored, feel this content unfamiliar, but it is very convenient, it should be able to use well.
Problems in code debugging and the resolution process
After-school operation question 1
Problem: No results
Did not hit%d
To modify the results
Other (sentiment, thinking, etc., optional)
Or more dozen code more practice to skilled use, and C language can be compared to learn, should be able to learn Java better.
Learning progress Bar
|
Lines of code (new/cumulative) |
Blog volume (Add/accumulate) |
Learning time (new/cumulative) |
Important growth |
Goal |
3500 rows |
28 Articles |
300 hours |
|
First week |
150/150 |
1/1 |
20/20 |
|
Second week |
200/350 |
2/2 |
40/40 |
|
Third week |
|
|
|
|
Week Four |
|
|
|
|
20145321 Java Programming 2nd week of study summary