Overview of object-oriented and method rewriting for C # Basic Learning (0702)

Source: Internet
Author: User

Object-oriented Programming (Oop==>object-oriented programming)

OOA: Object-oriented Analysis

OOD: Object-oriented design

OOAD: Object-oriented Analysis and design

What is object-oriented? A way to analyze the problem (enhancing the scalability of the program)

Three main features of object-oriented: encapsulation, inheritance, polymorphism

What is a class? What is an object? What are the differences between classes and objects?

* Classes are molds, create objects for molds, abstract

A class is a data type, a user-defined data type

Class composition: Fields, properties, methods, constructors, etc.

* The object is specific and is a concrete instance of the class. Objects have attributes (features) and methods (behaviors)

* The class contains data (represented by a field) and behavior (represented by a method (function, function) as a piece of code with a name)

Method Override Considerations:

When a subclass overrides a parent class method, the method signature and return value type must be consistent with the parent class, that is, the method name, the return value type, and the parameter list must be consistent. "Access modifiers are also consistent"

"Method signature": Generic refers to the method's "name" + "parameter list" of the method, and does not contain the method return value type

Overview of object-oriented and method rewriting for C # Basic Learning (0702)

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.