All mock tests are FREE till 31 December — register to save your progress
Unit 3 · Programming Languages and Computer Graphics Paper 2 CS · December 2022 Shift 2

Match List I with List II.
Choose the correct answer from the options given below:
List IList II
a. If the implementation of generated or derived classes differs only through a parameter, we haveI. to use a class hierarchy
b. If the actual types of objects used cannot be known at compile time, we haveII. improved run-time efficiency
c. If inline operations are essential and templates are used, we haveIII. to use templates
d. To gain access to differing instances of derived classes through a base, we haveIV. 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