Is it possible to define a class inside an interface ? I read that we can declare public abstract methods and final variables inside an interface but i never came across any code which defines a class inside an interface. please explain me.
you can define a class inside an interface. and this class is implicitly public static . in this way one can give a default implementation to clients(there are many other better way though).
Being a devil's advocate here, maybe we could discuss the following quote from Seetharaman:
you can define a class inside an interface. and this class is implicitly public static . in this way one can give a default implementation to clients(there are many other better way though).
Being a devil's advocate here, maybe we could discuss the following quote from Seetharaman:
you can define a class inside an interface. and this class is implicitly public static . in this way one can give a default implementation to clients(there are many other better way though).