20145316 Java Programming 2nd week study Summary textbook learning content Summary 3.1.1 Java type
is divided into basic types (Primitive type) and class type base types:
- Integers: Short (2 byte), int (4 byte), Long (8 byte)
- Byte (byte): -128~127
- Floating point: Float (4 byte), double (8 byte)
- Characters: 2 byte Chinese characters and English character are both double-byte storage
- Boolean: Logic True True false logic false (cannot be operated with other types)
3.1.2 Variable
Basic rules: Variable naming cannot start with a number, cannot use special characters, cannot have the same name as a Java keyword and a reserved word. If you want to fix a constant value no longer changes, you should add the final qualification to the declaration.
Use "'" to enclose characters.
3.1.3 operator
- Arithmetic operators: +,-, *,/,%, etc.
- Assignment operators: =, + =,-=, *=,/=,%=;
- Comparison operators: = =,! =, <, >, <=, >=;
- Logical operator:&, | , ^ , ! , &&, | | ;
- Bitwise operators:<<, >>, >>>, &, | ^
- Ternary operator: (conditional expression)? Expression 1: Expression 2;
3.1.4 Type Conversions
Automatic type promotion: All Byte, short, and char values will be promoted to type int, what other operands are, and what type the results are computed from;
Coercion type conversions: Forces the conversion of one type of operand to another type;
3.2 Process Control
- Judgment: If-else;
- Select: Switch;
- Loops: While, do while, for;
- Other: Break,continue, etc.
Problems in teaching materials learning and the solving process
Problem one: lack of understanding of idea, use of unskilled, from installation to operation there are many uncertain solutions-ask experienced students
Question two: Not familiar with the code-hosting process, not yet understood
Question three: Because the time rush to the code of the package understanding is not too deep, but I think this problem is not difficult should not ask the teacher, first find the answer.
Problems in code debugging and the resolution process
In the Notepad to do the textbook sample of the comparison code and debugging, the code is as follows:
A problem occurred in debugging: The main class could not be found or could not be loaded .
Run successfully after removing the code from the package.
Other (sentiment, thinking, etc., optional)
This chapter of learning feeling although more knowledge points, relatively trivial, but the content is relatively simple, a lot of knowledge in learning C language has mastered, compared to the 12th chapter of abstract Things think the third chapter is easier to understand, but there are some small knowledge point understanding is not thorough, such as type conversion, For example, break and continue can also be used in conjunction with the label, but also need to spend more time on this, after all, the content of this chapter is the foundation, learn basic grammar to learn in the future not laborious. The disadvantage is that because of their own fun to learn less time this week, debugging run code is mostly textbook examples, or learn from the textbook paradigm, not an independent wisdom, hope that in the future can devote more time and energy to learn java.
Learning progress Bar
Resources
- Java Learning Notes (8th Edition)
- Java Learning Note (8th Edition) Learning Guide
- ...
20145316 Java programming Second week of study summary