Saturday, October 20, 2012

Why do we have only public static final variables in interfaces?

Why do we have only public static final variables in interfaces?

Interfaces are protocol, templates. Classes implementing the interfaces, decide about the implementation
public: So that all the classes implementing the interface have access to everything inside class
static:So that the variables, methods inside interface belong to the interface
final:so that implementing classes don't modify the constants

No comments:

Post a Comment