c# - Does normal object base type - derived type conversion come under Covariance and contravariance? -
Provides built-in context conversion for co-operatives and novelists, arrays, delegations and common parameter types.
IEnumerable & LT; String & gt; Wire = new list & lt; String & gt; (); IEnumerable & LT; Object & gt; Objects = wires; & Lt; Object & gt; ActObject = SetObject; & Lt; String & gt; ActString = actObject;
Does the Common Object Base Type Derived Type Conversion come under Coversions and Violent As mentioned below?
Child Class = New Child Class; Baseclass basaspodge = buckwheat; Base class basebuzz = new baseclass; Childclass childbuzz = (base class) basebase;
If so, how runtime handles it and why not?
Co-type and hilarious applies only to parametric polymorphism, e.g. The reason for the type of other types of type are in the form of parameters, because the reasons for some use can also be compiled that they are not deeply typed, for example.
Your second example is just simple data polynomial which there is no need to apply empathy and corruption because those cases are not used.
Comments
Post a Comment