inheritance problem

G

goldie11

Hi,

I have two classes - A,B that inherit from an abstract class C.
The problem is that I need a global field which has always the same
value for the two classes. If I put the field in class C -
As I understand inheritance - both classes will recognize the field
but will have their own values.
Please help.

Thanks.
Ruthie.
 
G

goldie11

You need a static (class) variable.

Peter








- Show quoted text -

Thanks Peter .
My problem is solved - thanks. I just started to really understand all
the inheritance stuff.
 

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

Top