Upcasting and Downcasting in Object-Oriented Programming