20165324 "Java Program Design" The 3rd week study summary textbook Learning content Summary
Here's what to learn this week:
- Programming language Ideas
- The core of the process-oriented language is to write a block of code to solve a problem; In object-oriented language, the core content is the object, all around the object.
2. One of the core ideas of object programming: encapsulating data and manipulating data. Through abstraction, a general concept is formed.
Class definition: Include; class declaration and class body, in the form of:
class 类名{类体的内容}//class是关键字,用来定义类。
The purpose of a class is to abstract properties and behaviors that are common to a category of things (similar to the structure of a C language). The content of a class body consists of the declaration of a variable and the definition of a method.
Method Definition: Contains the method header and the method body. The format is:
方法头 {方法体的内容}//方法头由方法的类型、名称、和小括号里的参数列表所构成(与C语言中的函数相似)
- member variables and local variables: validity, the use of the keyword this, local variables must be guaranteed to have a default value, otherwise it cannot be compiled.
- UML Circles for classes: Three layers describe the main components of a class:
- First Layer: Name layer
- Second Layer: Variable layer
- Layer Three: Method layer
A construction method is a special method in a class that guarantees that the method name is consistent with the class name and has no type.
-. Create object: Contains the declaration of the object, assigns the variable to the object. (similar to C-language constructs) assigns objects using the new operator and the constructor of the class. Such as:
// 书本p62XiyoujiRenwu zhubajie;//声明对象zhubajie=new XiyoujiRenwu();//为对象分配变量//等价于:XiyoujiRenwu zhubajie=XiyoujiRenwu();//声明对象的同时为对象分配变量
Combination and reuse of objects
Instance methods and class method definitions: the instance method type is preceded by no keywords.
Use of this: this.x
the variable x that represents the current object.
Use of the package and use of import statements
Code Hosting
PS: There is a question, I clearly did not upload the code today, why the day code has more than 1000 lines, will it be because I sometimes the local files are all deleted, and then downloaded from the code cloud caused it?
Learning progress Bar
|
lines of code (new/cumulative) |
Blog Volume (Add/accumulate) |
Learning Time (new/cumulative) |
Important Growth |
Goal |
3000 rows |
30 Articles |
400 hours |
|
First week |
200/200 |
1/1 |
15/15 |
|
Second week |
300/500 |
1/2 |
12/27 |
|
Third week |
1000/1500 |
2/4 |
20/47 |
Resources
20165324 Java Programming 3rd week of study summary