hi ,
i want to know which if1 and if2 and w property has been implemennted.how do we know whether its of I or of J?
the code is showing no compilation error.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 29, 2012, 10:07 AM
Even though we've set w using interface references, we can still access it in both cases through a C reference.
However, if you want each interface to have separate implementations of w within C, then you need to use explicit interface implementation. Each implementation of w can then only be accessed via an interface reference of the appropriate type, as the following revised example shows:
If you tried to use c.W, instead of I.w or J.w, then you'd get a compiler error.
nishant kumarPosted Mar 30, 2012, 5:06 AM