Java-Preliminary Understanding-sixth-Object oriented (example)

Source: Internet
Author: User

One

This paper discusses two kinds of thought embodied in real life.

Video cited an example of saving a computer. The process-oriented idea is to search for hardware information on their own, to bargain, their own supervision of the business Assembly. The object-oriented idea is to find a person who knows and directs him to do it, and he must have the corresponding function.

Object-oriented comparison with process-oriented, improve efficiency, if you want to find the object that can have these functions first.

An object is an entity that is real, as long as it is an object. (I think there's one more thing to add, a functional entity)

In the world of Java, everything is object.

Two

The program handles the data and solves the problem. Data is owned, and Java uses an object to store N-data.

When doing the development, first find the object that the data belongs to. When analyzing a problem, first analyze which objects are involved. Do not pay attention to the action of the problem.

We focus only on the object, what objects are in this object, what objects are in this problem area, solve the problem, and find the object to solve the problem as far as possible. If not, create objects with such functionality to solve.

For the selection of objects, you have to practice the exercise many times. The person opens the door, the noun has two, the person and the door. But which one is the object? Door is the object, the door more than people know how to open, people are called the door "open" function.

Java-Preliminary Understanding-sixth-Object oriented (example)

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.