Hi,
can u help me with polymorphism and up-casting please.
Bipeds scream
birds fly
bird bd =new bied;
Bipeds bp
bp=bd(upcasting )//what does this line do?is it saying that the biped we have is a bird?
bp.scream
bd.scream
bd.fly
bp.fly (ERror) // why there is an error???bp=bd should not bp acts the same as bd???
can u help me with polymorphism and up-casting please.
Bipeds scream
birds fly
bird bd =new bied;
Bipeds bp
bp=bd(upcasting )//what does this line do?is it saying that the biped we have is a bird?
bp.scream
bd.scream
bd.fly
bp.fly (ERror) // why there is an error???bp=bd should not bp acts the same as bd???
Comment