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

Discussion

Which signature legally overrides Runnable.run?

  • A.public int run()
  • B.protected void run()
  • C.public void run()
  • D.public void run(String name)

Answer: C

The interface declares run with no parameters and a void return, so an override must match exactly. Adding a parameter makes it an unrelated overload rather than an override, changing the return type is illegal, and an interface method cannot be implemented with reduced visibility.

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

Post your comment

Please log in or register to post a comment.