The variables inside the interface are public static and final by default. So you can omit the modifier directly:
String param= "SSM";//variables need to be initialized
Why should the interface stipulate that member variables must be public static final?
For:
First, the interface is a highly abstract "template", and the interface property is the ' template ' members, it should be all implementation of the "template" implementation of the common characteristics of the class, so it is public static, is all the implementation class common. If it can be non-static, Because a class can inherit multiple interfaces, there are variables with the same name, how to distinguish them?
Second, if the interface can define non-final variables, and the method is abstract, it is paradoxical that there are variable member variables but the corresponding methods can not manipulate these variables, although the values of these static member variables may be directly modified, but all the implementation class corresponding values are modified, What is the difference between this and an abstract class? Interface is a higher level of abstraction, is a specification, functional definition of the declaration, all the mutable things should be attributed to the implementation class, so that the interface can be standardized, standardized role. So the attributes in the interface must be final.
Finally, the interface is just a higher level of abstraction of the properties and behaviors of things. For the modification to close, open for extensions (different implementations implements), the interface is an embodiment of the closed principle (open-closed Principle).
Why should the interface stipulate that member variables must be public static final? (EXT)