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
windows c# using datagridview in edit form sql server
Write a program in c# to find the angle between the hours and minutes in a clock?
Is datetime value type c#?
Where do we use serialization in c#?
What is unrecognized escape sequence in c#?
What is expression c#?
Can I fly with a loop recorder?
List the fundamental oop concepts?
What is the default value of boolean variable?
what is .NET framework architecture ??
What do you mean by thread safe in c#?
Why attributes are used in c#?
What does private void mean in c#?
What is the default value of guid in c#?
What is the difference between firstordefault and first?