Object-Oriented Programming -- define basic classes and derived classes [continued]
IV,VirtualAnd other member functions
Function calls in C ++ do not use dynamic binding by default. To trigger dynamic binding, two conditions must be met:
1) only
[. Net you must know] (6): go deep into the keywords --- base and this
Author: anytao
This article introduces the following:
Basic object-oriented concepts
Basic keywords
This keyword is easy to understand.
1.
Tag: Add text log to implement local analysis instance system compilation? Is it possible to use base and this in static methods, why?? What are the common uses of base? What are the this often used in?? Can base access all members of the base class?
The New keyword has aroused a lot of attention, especially thanks to Anders Liu's supplement, let me feel that the communication platform given by the blog Park is really ubiquitous. So, we need to continue this topic, to carry out the key words
C # base and this
-- From Rocky Ren
2. Basic Concepts
Base and this are attributed to access keywords in C #. As the name suggests, they are used to implement access operations of the Inheritance Mechanism to satisfy access to object members, this
1. member functions that cannot be automatically inherited
Constructor (including copy constructor)
Destructor= Operator
Ii. Inheritance and constructor
The constructor of the base class is not inherited. You must declare your own constructor In
1, why the size of the class is not allowed in C + + is 0Class Zerosizet {}; Zerosizet Z[10];&z[i]-&z[j]; is usually obtained by dividing the number of bytes between two addresses by the type size, while the type size is 0 will be problematic2, why
ObjectiveThis article mainly to explain in C #, I feel that the master is not good or not much, not too familiar with the keywords, mainly including base, this, new, override, abstract, Virtual and execution issues between the static field and the
The example in this article explains the transformations between the base class and the derived class in C + +. It will help to understand the object-oriented programming of C + +. Note here: The premise of this example is that the derived class
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.