Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is an extension method in c#?

950


What does void mean in c#?

934


What are the string functions in c#?

929


What is datasource c#?

860


What is difference between a function and a method?

897


What is the relationship between a process, application domain, and application?

914


Why do we need indexers in c#?

872


What is Covariance and contravariance in C#?

1010


How can I create image pieces/sub image?

904


What is oledb in c#?

897


Write the difference between TypeOf and GetType?

1004


what are some characteristics of an array?

915


Explain dataset.acceptchanges method in .net?

913


What do you mean by casting a data type?

902


What is executenonquery c#?

845