• 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
  • 0
  • 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
  • 0
  • 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.

 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic