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 property in c#?

868


What exactly happens when we debug and build the program?

2351


How do I do implement a trace?

1011


Explain async and await?

1760


What is global namespace in c#?

908


What is an enumerator c#?

878


What is difference between list and dictionary in c#?

817


Can we change static variable value in c#?

874


How can I check the type of an object at runtime?

911


What is difference between array and arraylist in c#?

887


Why dictionary is faster than list?

906


How do I use the 'using' keyword with multiple objects?

898


Why do we use lambda expression in c#?

895


How do you prevent a method from being overridden in c#?

809


What does typeof return c#?

876