Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: sargasso on March 17, 2004, 02:31:08 pm

Title: Abstract class constructors
Post by: sargasso on March 17, 2004, 02:31:08 pm
Herewith, my entry for "Dumbest question of the Week" 8)

Can an abstract class have a constructor?  What I mean is, even though (to us) an abstract class constructor seems to be a meaningless concept, are there any circumstances where it would not be meaningless.

???
Bruce
Title: Re: Abstract class constructors
Post by: jkorman on March 17, 2004, 07:20:44 pm
Sure. Consider

public abstract class Foo {

 Foo() { init(); }

  public abstract init();
}

The method init() is declared and used in the abstract base class, but is defined
in some concrete inheriting class.

Jim
Title: Re: Abstract class constructors
Post by: sargasso on March 17, 2004, 08:46:45 pm
Considering ....


PHP?