79298179

Date: 2024-12-20 19:08:11
Score: 1
Natty:
Report link

While its not likely to be the answer you want: Interfaces in Java cannot specify that a static method shall be present.

While its debatable if they SHOULD, at the moment they cant.

So this is not possible at compile time.

So you would have to do it at runtime using introspection to see if the static method is present and if not throw an exception or some error etc.

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Dave