1. Static methods are the default type of methods. They are called just like normal procedures and functions. The compiler knows the addresses of these methods, so when a static method is called, it can statically link the running information into the executable file. , so static methods are the fastest, but they cannot be overridden to support polymorphism.
2. Virtual methods and static methods are called in the same way. Because virtual methods can be overridden, the compiler does not know the address of a specified virtual method when it is called in the code. Therefore, the compiler looks up the function address at runtime by building a virtual method table (VMT). All virtual methods are processed through VMT at runtime. In addition to the virtual methods defined by itself, an object's VMT table also has all its virtual methods. Therefore, virtual methods use more memory than dynamic methods, but It executes relatively quickly.
3. Dynamic methods are basically similar to virtual methods, except that their height systems are different. The compiler assigns a unique number to each dynamic method and uses this number and the address of the dynamic method to construct a dynamic method table (DMT). Unlike the VMT table, there are only dynamic methods declared in the DMT table, and this method requires the ancestor DMT table to access other dynamic methods. Because of this, dynamic methods use less memory than virtual methods, but they are slower to execute because they may have to search for dynamic methods in the DMT of the object.
4. The OP uses overriding to make a method show different behaviors in different derived classes. The methods that can be overridden in the OP are methods that are marked as virtual or dynamic when declared. To override a method, use override instead of virtual or dynamic in the derived class declaration. After using override, the compiler will replace the original method in VMT with a new method, and the original method still exists. If you use override to declare a static method again, it is a real override, which is completely covered by the new method. Replace the same method in the ancestor class.