I have a driver class and two subclasses of it which both implement an interface of 6 methods. One of those methods are implemented exactly the same so i have the exact same block of code in each class. So i thought i would put it in the driver superclass so they could both inherit it. But that causes 2 problems. 1) the subclasses no longer implement it if they inherit in from a superclass(I think, correct me if I'm wrong), and 2) The method calls 2 other methods inside of it. One of which is in the superclass(when the this was in the subclasses, this was no problem as it would just call the method from there since it inherits it), and the other method it calls is in each subclass, but the method is named the same thing for each subclass. So when i put this common method in the superclass so the subclasses inherit it, it can't find the symbol for the method in the subclasses unless i call it with an instance of the subclass. But, that won't work since theres two subclasses i need to use it for. To clear it up:
Driver SuperClass HWhelper.
Subclasses DiscountTax & Factor both implement Runnable.
Interface Runnable implemented by Factor & DiscountTax.
Runnable methods:
scanInput(), calcResults(), printResults(), help(), run(),
again().
these are all implemented in Factor & in DiscountTax. But the implementations for again() in each class are identical. I think you can see my problem of putting the method in the superclass now, Because this is the code for again:
public void again() {
System.out.print("Would you like to perform another calculation? (Y/N)"); // ask user
String choice = input.next(); // store input
while(!(choice.equalsIgnoreCase("Y")) && !(choice.equalsIgnoreCase("N")) // If the input is invalid
&& !(choice.equalsIgnoreCase("YES")) && !(choice.equalsIgnoreCase("NO"))) {
System.err.println("\t\t\t*** Error: Invalid Input"); // print error message and try again
System.err.println("\t\t\t*** Expecting java.lang.String Y/N/YES/NO");
System.err.println("\t\t\t*** Discarding input " + choice);
System.err.println("\n\t Please choose again");
System.err.print("\t\t\t\t\t");
choice = input.next();
}
if((choice.equalsIgnoreCase("Y")) || (choice.equalsIgnoreCase("Yes"))) { // if they answered yes
run();
} else if((choice.equalsIgnoreCase("N")) || (choice.equalsIgnoreCase("No"))) { // if they answered no
whereNow(); // where now?
}
}
whereNow() is a method in HWhelper. So when again() is in Factor and DiscountTax, it can run like that since an instance of F/DT(Factor/DiscountTax) is a HWhelper object. run() is a method in DT and a method in F but they are implemented differently, so I cant make a DT object and call run or do the same with F. HELP!

thanks in advance.


EDIT: I could of course just put the same code in each class but i think there a better way to do it.
Actually the run methods in each subclass are identical, the only difference is the methods they call - although having the same names (making the run methods identical since they call them in the same order), they call their own methods which
are different.