Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

base and derived class

Name: Anonymous 2011-08-09 16:36

What is the difference between the objects 'dc' and 'bcdc', in the following bit of code (C#, may apply to other languages as well):
BaseClass bc = new BaseClass();
DerivedClass dc = new DerivedClass();
BaseClass bcdc = new DerivedClass();

Why would you use one over the other? I found it on a page that explained the difference between new and override&virtual
http://msdn.microsoft.com/en-us/library/ms173153%28v=VS.100%29.aspx

Name: Anonymous 2011-08-10 13:04

>>10
I don't program in C#, but it looks like the answer is the obvious one: dc is of type DerivedClass, and bcdc is of type BaseClass.
Your wrong, morraine.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List