Java-Preliminary Understanding-The sixth chapter-Object oriented

Source: Internet
Author: User

I. Overview

An object is an entity, and object-oriented is looking at an object.

In contrast to object-oriented, process-oriented is a kind of thought, whether object-oriented or process-oriented.

There are differences between procedures and objects.

Example: Put an elephant in the refrigerator.

Process oriented: Open the refrigerator, store the elephant, and close the refrigerator.

What does the process mean? Refers to the action, the action is mainly to do things. With the action, you step-by-step execution.

Process-oriented thinking, focusing on the process (action). What you've learned before is process-oriented, defining features, and performing functions.

C language is a process-oriented language, which is embodied in the form of functions, and the function is called and executed.

Two

Thought-oriented: the emphasis is on objects (entities).

For example, elephants and refrigerators are entities, and elephants are a cargo in a refrigerator.

For refrigerators, open, close and store, it is the clearest of its own. For the refrigerator purchased, it has the function of opening and closing itself. As soon as the refrigerator is found, these features are found.

In object-oriented, we are dealing with an action, and now we are dealing with an object, an entity. The object has the functionality that we need. The function is encapsulated by the object.

Example of operation: refrigerator open, refrigerator storage, refrigerator off. It's a lot easier to find the fridge, and the problem is solved.

Here arises a question, how to choose the object ?

Object-oriented Features: 1. Object-oriented is a habit of thinking. 2. Object-oriented presence, simplifying complex issues. (Object-oriented is easier to solve than process-oriented, so you have to face a lot of actions before, just face an entity.) 3. The advent of object-oriented, so that once in the process of the executor, into the object of the leader.

Java-Preliminary Understanding-The sixth chapter-Object oriented

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.