Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Looking for a strategy for solving upcasting/downcasting questions

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any workable strategy for solving casting questions? I understand when upcasting and downcasting is allowed but when the questions tend to have multiple objects involved i tend to get confused pretty quickly. For example, what is the best approach to a question like this:



Is there any approach to use to solve a question like above? For example can the references be drawn somehow so that i can get a visual representation and can that help?

Thanks
 
Abdullah Mamun
Ranch Hand
Posts: 99
Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually would like to execute each line and put the updated result beside the same line.
Below is an example in comment.
Not sure if it will help you.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic