Can we put a static method in interface?

Thảo Justin

New member
Can we put a static method in interface?
Answer
Similar to Default Method in Interface, the static method in an interface can be
defined in the interface
, but cannot be overridden in Implementation Classes. To use a static method, Interface name should be instantiated with it, as it is a part of the Interface only.
 

Tìm kiếm

Back
Top