The questions are as follows:
All functions in the parent class Dad are pure virtual functions; defining the subclass Son; allocating an Object of abstract class type “XXX”;
The reasons are as follows:
At instantiation time:
(a) It is important to ensure that all pure virtual functions of the superclass are implemented, otherwise the subclasses still cannot be instantiated;
(b) The inherited virtual function must be guaranteed to have the input type of the function and the return value type is consistent, otherwise the virtual function of the parent class is not instantiated;
(c) When the enumerated type inside the class ACTS as the function parameter type, the subclass needs to define itself, otherwise the type is inconsistent;
All functions in the parent class Dad are pure virtual functions; defining the subclass Son; allocating an Object of abstract class type “XXX”;
The reasons are as follows:
At instantiation time:
(a) It is important to ensure that all pure virtual functions of the superclass are implemented, otherwise the subclasses still cannot be instantiated;
(b) The inherited virtual function must be guaranteed to have the input type of the function and the return value type is consistent, otherwise the virtual function of the parent class is not instantiated;
(c) When the enumerated type inside the class ACTS as the function parameter type, the subclass needs to define itself, otherwise the type is inconsistent;
Read More:
- Error c2259 cannot instance abstract class due to following members
- Error c2011: “a certain class”: redefinition of “class” type
- Report error when using microwave “must either be declared abstract” abstract method “getWXPayDomain()” in WXPayConfig
- C# Member XXX cannot be accessed with an instance with an instance reference;qualify it with a type
- Abstract precautions
- When C language refers to a user-defined type as a parameter, an error segmentation fault is reported
- Unit Android converts c# class to JSON file and reports an error
- C++:error C2228: left of ‘.str’ must have class/struct/union
- C ා programming encountered an object reference is required for the non-static field, method, or property error
- Type error: cannot unpack non Iterable non type object appears when starting Bert server in Ubuntu system
- Error type referred to is not an annotation type:RedisCache
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +
- [Solved] RuntimeError: Expected object of scalar type Float but got scalar type Double for argument #2 ‘mat1‘
- Java gets the type t.class of generic t
- To solve the problem of C # calling excel interface error, prompt: the COM object of Microsoft. Office. Interop. Excel. Applicationclass is forcibly converted to the interface type “Microsoft. Offi”
- array type has an incomplete element type
- Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation
- Error: requesting member ‘*’ of ‘*’, which is a non-class type ‘*’
- Pit encountered by entity class data type BigDecimal
- [Qt] error: call to non-static member function without an object argument