Getting Started with Java objects

Source: Internet
Author: User

Five characteristics of objects

(1) Everything is an object. The object can be imagined as a new variable; it holds the data, but it can require manipulation of itself. Theoretically speaking,

All conceptual components can be presented from the problem to be solved, and then expressed as an object in the program.

(2) A program is a combination of a large set of objects; Through messaging, each object knows what to do. In order to make a request to the object, you need to

"Send a Message". More specifically, you can think of a message as a call request that calls from a sub-Lie Cheng that belongs to the target object or

Function.

(3) Each object has its own storage space, which can accommodate other objects. Alternatively, you can create new objects by encapsulating existing objects. So, despite

The concept of objects is very simple, but in the program can achieve any high complexity of the program.

(4) Each object has a type. Each object is a "instance" of a "class", according to the syntax. where "class" is "type"

The synonyms. The most important feature of a class is "what message can be sent to it"

(5) All objects of the same class can accept the same message. This is a statement that is actually not meaningful and can be understood. Because one of the types is a circle (circle)

Objects also belong to an object of type shape, so a circle can receive shape messages entirely. This means that the program code can be unified to command the "shape"

It automatically controls all objects that conform to the "shape" description, which naturally includes "circles." This feature, called the "Calling of the object", is one of the most important concepts of OOP.

Getting Started with Java objects

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.