Can I ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I have an abstract class which declares a static variable but does not
define it and then I have another class which is a static class inherit from
the abstract class and define the data which will reside in that static
variable?
 
Jim Heavey said:
Can I have an abstract class which declares a static variable but does not
define it and then I have another class which is a static class inherit from
the abstract class and define the data which will reside in that static
variable?

No. There's no polymorphism on static members.
 
Jim said:
Can I have an abstract class which declares
a static variable but does not define it and
then I have another class which is a static
class inherit from the abstract class and
define the data which will reside in that static
variable?

No - you can't override static members. I wanted that once; in my
case, I got around it by using a virtual property that returned a
different constant value in each class.

Eq.
 
Back
Top