Tuesday, June 19, 2007

Playing with OOPS

I have 3 classes

class A, B and C.

In class A and class B, i've a data member : public int i;

ill inherit class B from A.

class B : A

After this, i've two variables "i" having the same name.

Now , can i access both the values just one using one object ??

I can use base in C# and mybase in vb.Net, but i dont want to use them in constructor..

If, i have one more class like this..

class C : B

Then, in class C, can i create a single object, using which i can access both the base class A and Derived Class B's data member "i" ?

Stilll looking for an answer/solution.

Hope i find one soooner...........

0 comments: