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 to use lock statement in c#?
What is hashmap in c#?
What is meaning of type safety in c#?
Are structs faster than classes?
What is c# used for in the industry?
What is oledbconnection c#?
What is a decimal in c#?
What are delegate methods?
What is Assembly. and Describe type of assembly. why most developer happy with private assembly.
What is ilist c#?
What are actions in c#?
What is sqlcommandbuilder c#?
Can a struct be null?
When should we use delegates in c#?
What are the namespace level elements?