20165324 Java Programming 3rd week of study summary

Source: Internet
Author: User
Tags class definition instance method

20165324 "Java Program Design" The 3rd week study summary textbook Learning content Summary

Here's what to learn this week:

    • Programming language Ideas
    1. 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:
    1. First Layer: Name layer
    2. Second Layer: Variable layer
    3. 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
    • Java Learning Notes (8th Edition)

    • Java Learning Note (8th Edition) Learning Guide
    • ...

20165324 Java Programming 3rd week of study summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.