Match List I with List II.
Choose the correct answer from the options given below:
| List I | List II |
|---|---|
| a. If the implementation of generated or derived classes differs only through a parameter, we have | I. to use a class hierarchy |
| b. If the actual types of objects used cannot be known at compile time, we have | II. improved run-time efficiency |
| c. If inline operations are essential and templates are used, we have | III. to use templates |
| d. To gain access to differing instances of derived classes through a base, we have | IV. to use explicit casting |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. a-III, b-I, c-II, d-IV
Explanation
Variation only through a parameter calls for templates; types unknown until run time call for a class hierarchy; inline operations with templates give run-time efficiency; reaching differing derived instances through a base needs explicit casting.More Programming Languages and Computer Graphics questions
- In what sequence are initialisation, testing and execution of the body done in a do-while loop? I. Commenting II. Execution of the body III…
- Assertion A: A raster-scan device is a CRT graphics device and can use a television monitor for display. Reason R: In a raster-scan display…
- The hidden-surface removal problem with a minimal 3D pipeline can be solved with
- The condition num != 65 cannot be replaced by
- Pointers cannot be used to
- Which mechanism in XML allows organisations to specify globally unique names as element tags in documents?