Machine-translated by Google. Questions are authored in English.
Top

Discussion

How many abstract methods does Runnable declare?

  • A.One
  • B.Two
  • C.None
  • D.Three

Answer: A

Correct answer: One

Runnable declares only run(), which is what makes it a functional interface and so expressible as a lambda. Having exactly one abstract method is the requirement for that, and it is why Runnable, Callable and Comparator can all be written as lambdas.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.