Did it possible to cast a generic type of derived class to
generic type of base class?
Answer Posted / lalit pradhan
Good explaination Karthikeyant :)
Also in addition to that the following cast is also not
possible. It will compile but give you casting error on
compile time.
DerivedClassGenrics<int> derivedClassGenrics = new
DerivedClassGenrics<int>();
BaseClassGenrics<int> baseClassGenrics = new
BaseClassGenrics<int>();
derivedClassGenrics = (DerivedClassGenrics<int>)
baseClassGenrics;
Enjoy!!!
Lalit Pradhan a.k.a DOTNET Gadha
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why do we use partial class in c#?
Can we maintain state in webservice?
What are the benefits of using generics?
What is default parameter in c#?
What is a deadlock lock?
What is a float?
Is it possible to have different access modifiers on the get/set methods of a property in c#?
What is cts, clr?
How many bytes is an int in c#?
What is a delegate? Explain.
How we can create an array with non-default values?
What are the different ways of method can be overloaded?
What are jump statements in c#?
What is c sharp language?
Which class does the remote object has to inherit?