I have the following class:
public abstract class Step {
public abstract <S,T> S makeAStep(S currentResult, T element);
}
and I'm trying to implement it, so it will take two ints and return their sum, something like this:
public class sumOfInts extends Step {
public <Integer,Integer> Integer makeAStep(Integer currentResult, Integer element){
return currentResult + element;
}
}
but I get the following error:
Type sumOfInts must implement the inherited abstract method Step.makeAStep (S, T)
please help me (I need this for my homework in programming courses)
I ask you to very kindly write me a code that does what I want to execute, that will not have any errors or warnings, thanks in advance
ronen source
share