-1

I'm working on getting my interface to extend TimerTask in Java. But my code will give the next error: "Interface expected here" at the declaration of the interface.

import java.util.List;
import java.util.TimerTask;


public interface IEffectenBeurs extends TimerTask {

   public List<IFonds> getInfo();

   public void run();

}
Guido
  • 1,161
  • 3
  • 12
  • 33

1 Answers1

2

TimerTask is an abstract class. Therefore an interface can't extend it. Your IEffectendBeurs could either extend Runnable or you could transform it to an abstract class too.