Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    No, there is no way to force the implementation of a static method. Commented Oct 2, 2014 at 3:36
  • 1
    Why does it need to be static? Commented Oct 2, 2014 at 3:36
  • 3
    Some kind of factory would better apply here. Commented Oct 2, 2014 at 3:37
  • or you could just use some other class with a static method such as fromSentence(String,Relation)? Commented Oct 2, 2014 at 3:51
  • 1
    Those subclass-specific things should be done by the subclass through polymorphism. Or check out the Visitor pattern. Commented Oct 2, 2014 at 4:22