A

Admin • 831K Points
Coach

Q. What is the syntax to implement a `Runnable` using a lambda?

  • (A) () -> System.out.println("Run")
  • (B) (String s) -> System.out.println(s)
  • (C) x -> System.out.println(x)
  • (D) (int x, int y) -> x + y

Explanation by: Admin
`Runnable` has no parameters, hence the lambda takes `()`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.