Exercises in this lecture              Go to the slide, where this exercise belongs -- Keyboard shortcut: 'u'  

Exercise 8.1
Parameter variance


First, be sure you understand the co-variance problem stated above. Why is it problematic to execute aref.Op(sref)in the class Client?

The parameter variance problem, and the distinction between covariance and contravariance, is not really a topic in C#. The program with the classes A/B/S/T on the previous page compiles and runs without problems. Explain why!


Solution