Check If Java Interface Method Is Populated -
i have interface implemented next method: public void shutdown()
quite few of classes implement method not utilize it. there way check if body of implementation has content in it?
i suppose add together boolean
check, i'd avoid additional overhead.
in subclass, can throw java.lang.unsupportedoperationexception
in shutdown()
if there no implementation.
your calling class need grab exception you'll know class doesn't implement method.
java
No comments:
Post a Comment