16. final keyword and permission modifier
01_final keyword concept and four usages
The final keyword represents the final and unalterable.
There are four common uses:
Can be used to decorate a classCan be used to modify a methodIt can also be used to modify a local variableIt can also be used to modify a member variable
02_ The final keyword is used to decorate a class
When th ...
Added by grga on Tue, 04 Jan 2022 20:27:41 +0200
Try to understand virtual functions thoroughly! (test platform: vs2018+win10)
First, link to several blog addresses: Analysis of C + + virtual function table
cout << "Virtual function table address:" << (int*)(&b) << endl;
cout << "Virtual function table - first function address:" << (int*)*(int*)(&b) << endl;
In this blog, cout < < virtual function table add ...
Added by ac1982 on Sat, 25 Dec 2021 19:35:10 +0200
Advanced Java | viewing object-oriented as a whole
1, Object oriented
Object oriented is the core idea of Java programming. Its basic characteristics are inheritance, encapsulation and polymorphism.
1. Feature encapsulation
The structure, data and operation are encapsulated in the object entity. When using, you can not pay attention to the internal structure of the object and can only access ...
Added by jswinkelman on Sat, 25 Dec 2021 17:25:02 +0200
Understanding of java polymorphism
1, What is polymorphism
The three characteristics of object-oriented are encapsulation, inheritance and polymorphism.Definition of polymorphism: parent class reference variables can point to subclass objects, allowing different objects to call the same method, that is, the same method can have different implementation forms according to differ ...
Added by jakem on Sat, 27 Nov 2021 01:09:59 +0200
Three characteristics of C + + object-oriented -- polymorphism
catalogue
1: Concept of C + + polymorphism
2: Implementation of C + + polymorphism
3: C + + virtual function
1. Items needing attention when using virtual functions
2. Pure virtual function
1: Concept of C + + polymorphism
"Polymorphism" means ...
Added by 1042 on Sat, 20 Nov 2021 15:43:42 +0200
java inheritance and polymorphism
java inheritance and polymorphism
preface
Tip: the following is the main content of this article. The following cases can be used for reference
1, What is inheritance?
If class B has all the attributes and methods of class A, and has some special attributes and methods, class A is called a general class. Class B is called a spec ...
Added by vijdev on Sat, 02 Oct 2021 20:58:20 +0300
JAVA object-oriented inheritance and polymorphism simple understanding and examples
Program requirements
1. Write a Cat class and implement a shout() method, which can output the kitten's meow
2. Modify the above program to declare a field name and a constructor with parameters for Cat class, so that the name of the object can be set when instantiating the object; It also enables the shot () method to output the name of the ...
Added by FarhanKhalaf on Tue, 07 Sep 2021 08:56:19 +0300