Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
>> Is there anyway (through either inheritance or interfaces) > Static methods are bound at compile time based on the type of This seems really ugly. I'm assuming that when someone tries to do this, the compiler chucks a warning. Otherwise, you'd get unexpected results. I came across the need for this same thing in my project, however, and what I ended up doing was creating an abstract factory class to correspond with the abstract class. To create objects of a new type, you override the factory class at the same time you override the other class. Static methods in the factory class ensure that only one instance of each factory class is created. Replies:
|
Sponsored Links
|