There are 4 Main features of object-oriented programming: abstraction, encapsulation, inheritance and polymorphism. 9.1 Concepts of inheritance and derivation
Base class A
Cannot be inherited part
Can
In section 9 binding [9], in addition to restricting access, the access method also determines which method calls the quilt class or which attribute accesses the quilt class. the association between function calls and functions and the relationship
The first part: MacroWhy use macros? because a function call must transfer the execution order of the program to an address in memory of the function, the program content of the function is executed and then returned to the place before the function
Chapter 6th of. NET Design Specifications: scalable design,Chapter 2: scalability design 6th Extension Mechanism
Consider using a non-sealed class that does not contain any virtual or protected members to provide scalability for the framework. The
In addition to restricting access, the access mode also determines which method will be called by the quilt class or which property will be accessed by the quilt class. The Association of a function call to the function itself, and the relationship
*
+-------------------------------------------------------------------------------+
| = This is haohappy read
>
| = Notes in Classes and objects Chapter
| = Translation-based + personal experience
| = Please do not reprint in order to avoid the
In addition to restricted access, the access method also determines which method calls the quilt class or which attribute accesses the quilt class. the association between function calls and functions and the relationship between member access and
One or three ways of inheritingPublic members of private base classes and protected members become private members of derived classesmember access rights for public base class are not changedProtected the public and protected members of the base
1. Three ways to inherit:Public inheritance, private inheritance (private), protection Inheritance (protected)A description of the three inheritance methods, as shown in the following table:
Characteristics
Public inheritance
[Java Study Notes] Chapter 5 inheritance of Java core technologiesChapter 2 Inheritance
Using inheritance, You can construct a new class based on an existing class. Inheriting existing classes is to reuse (inherit) the methods and domains of these
Is-a, Has-a, and like-a, grouping, aggregation, and inheritance the difference between the two sets of concepts-cbk861110 column-Blog channel-Csdn.net http://blog.csdn.net/cbk861110/article/details/9028189Public succession emphasizes the
classes, objects, and members of C + + 1. declaration of a classA class is a user-defined type, and if a class is used in a program, the definition must first be declared. The syntax form for a class declaration is as follows: class name
1 virtual is used to enable dynamic binding. In addition to the number of constructors, any non-static member function can be a virtual function. Virtual only appears in the member function declaration of the class and cannot be used in the function
Core content:1. Concepts related to packages in Java2. Specific usage of access control in Java (detailed)
1. Briefly describe the concept of package in Java
Packages in Java are similar to folders in the operating system,
1. The difference between a reference and a pointer1) When the reference is created, it needs to be initialized, and the pointer can wait until it is initialized at any time.2) The reference cannot point to null, and the pointer can point to NULL3)
Object-Oriented Programming-Overview, definition of base classes and derived classes
Introduction:
Object-Oriented programming is based on three basic concepts: data abstraction, inheritance, and dynamic binding.
In C ++,Data abstraction using
Object-oriented programming is based on three basic concepts: Data abstraction, inheritance, and dynamic binding. In C + +, you use classes for data abstraction, and class derivation to inherit another class from one class: Derived classes inherit
When Private,public,protected is simply set as a member permission in a class:Private: can only be accessed by a function in the class, its friend function, and cannot be accessed by any other object of the class.Protected: can be accessed by
Static as the name implies. In this I would like to systematically tell about the role of the static keyword, of course, mainly to tell it in the development of language C and C + + role, in other aspects of the role please find additional
The inheritance methods in C + + are:Public, private, protected three (they directly affect the members of the derived class, and the rules that their objects access to the base class members).(1) Public: Inheritance keeps the properties of the
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.