title: How to give a child class a modified inherited method?
body: <p>I'm facing a trouble finding the best OOP design solution to the following problem: I have the parent abstract class <code>Classifier</code> which includes the abstract method <code>classify(Instances dataset)</code>. Two classes extends <code>Classifier</code>, namely <code>NormalClassifier</code> and <code>ThresholdClassifier</code>. Both the children classes implements the <code>classify(Instances dataset)</code> method. However, <code>ThresholdClassifier</code> requires the <code>classify(Instances dataset)</code> method to be of this form <code>classify(Instances dataset, double threshold)</code> and can't never work with <code>classify(Instances dataset)</code>.</p>
  
  <p>Note that <code>ThresholdClassifier</code> can't accept the <code>threshold</code> parameter in its constructor and it must have the parameters in the <code>classify</code> method.</p>
  
  <p>In this case the child class <code>ThresholdClassifier</code> share the same characteristic as the parent but it requires a different method signature. I'm not able to extend the parent class because it would require me to implement the original method signature nor it makes sense not to extend the parent class because it's clearly a <code>Classifier</code>. So how would one solve such a design problem in Java OOP? Is there a technical term for this issue?</p>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>what I basically did to solve this issue is that I created an interface called <code>ThresholdBasedClassifier</code> that contains the method <code>setThreshold(double threshold)</code>. Then I made <code>ThresholdClassifier</code> implement this method and created an internal field called <code>threshold</code>. However, I find this to be an ugly design solution for many reasons, especially that the user could forget that he needs to set <em>change</em> or set the threshold before calling <code>classify(Instances dataset)</code></p>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>Also the requirements says that there can't be a default value for the <code>threshold</code>.</p>
  
  <p><strong>Edit 3:</strong></p>
  
  <p>My example above was just an example to a common design problem I'm facing in general. So I'm looking for a general solution not a specific solution.</p>