OOP

  • Thread starter Thread starter frazer
  • Start date Start date
F

frazer

hi i dont understand this syntax.
can anyone explain this and break it up across 2 lines?



image1 = ((ChildInstance)ParentInstance).Image

why do we need to use this syntax?

thnx
 
frazer
can anyone explain this and break it up across 2 lines?
image1 = ((ChildInstance)ParentInstance).Image

1. ChildInstance ci=(ChildInstance) ParentInstance;
2. image1 =ci.Image;
why do we need to use this syntax?
To save on unnecessary creation of a temporary variable (e.g. ci) in a two
step process.

Fakher Halim
Software Architect,
TPG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top