Top "Upcasting" questions

Upcasting permits an object of a subclass type to be treated as an object of any superclass type.

What is the difference between up-casting and down-casting with respect to class variable

What is the difference between up-casting and down-casting with respect to class variable? For example in the following program class …

java casting class-variables downcast upcasting
Why do we assign a parent reference to the child object in Java?

I am asking a quite simple question, but I am bit confused in this. Suppose I have a class Parent: …

java oop inheritance casting upcasting
downcast and upcast

I am new to C# (and OOP). When I have some code like the following: class Employee { // some code } class …

c# oop downcast upcasting
C++ - upcasting and downcasting

In my example: At upcasting, shouldn't the second d.print() call print "base"? Isn't it "d" derived object upcasted to …

c++ class inheritance downcast upcasting
Upcast an object

I am searching a way to get the possible types for upcasting an object. For example: I have a control …

c# .net reflection casting upcasting
up-casting std::shared_ptr using std::dynamic_pointer_cast

I'm starting to work with smart pointers in C++0X/11 and I've run into a peculiar situation. I want to …

c++ c++11 shared-ptr upcasting