Several Basic concepts of Object-Oriented Programming

Source: Internet
Author: User

Object-orientedProgramThe design consists of six concepts:
1. Class: it is the basic structure of every Java program. It contains data domains and data operation mechanisms. The class provides templates for creating these software objects.
2. Object: an object is an instance created using a class as a template and can be used to generate any number of objects.
3. encapsulation: Allows or disables the functions of data and member methods of a category or object.
4. Overloading: A member method can have multiple definitions. Different definitions can be selected based on different requirements.
5. Inheritance: Obtain the features that the relevant class already has.
6. Polymorphism: the ability to process multiple correlated classes based on common features and call methods of different classes according to different environments.
Defining a class can be divided into three parts:
1. Is: indicates the class "what", that is, the class name and its nature, such as the parent class and modifier of A Class. This part is called the class declaration.
2. Has: Describes the "what" features and attributes of this class. These features and attributes are represented by domain variables, which are called member variables.
3. Does: describes what the class can "do", that is, the behaviors of the class. These behaviors are described by instance methods and class methods. These methods are collectively referred to as member methods.
The is and has constitute the status of a class, and does is the behavior of a class.

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.