I am trying to create a timer to print out from an ArrayList at a schedule. But I am receiving this error:
Cannot resolve method 'schedule(<lambda expression>,int,java.util.concurret.TimeUnit)'
Why am I receiving this error and what can I do about it?
List<String> finalQuestionsList = questionsList;
timer.schedule(()-> finalQuestionsList.forEach(write::println),120, TimeUnit.SECONDS);