Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaExecutorService usageSingle-choice MCQ

Using a single-threaded ScheduledExecutorService, a task scheduled with `scheduleAtFixedRate` throws an uncaught exception on its second run. What happens to subsequent runs?

scheduler.scheduleAtFixedRate(() -> { count++; if (count == 2) throw new RuntimeException("die"); }, 0, 30, TimeUnit.MILLISECONDS);