public static final String MY_STRING = "HELLO";
Then it's because they are constants.
For example the interface methods should have the modifiers public and abstract for inheritance purposes..
so what is the reason for declaring the variables as static, final..
Somebody please help..
[ June 21, 2008: Message edited by: Campbell Ritchie ]
Originally posted by Rob Prime:
Interfaces do not have any implementation details. Since instance and static variables are part of the implementation, they cannot be part of interfaces. Hence the only "variables" that can be part of interfaces are actually constants - static and final. And everything in an interface is public.
Can someone explain why Java constants (final variables) are NOT part of implementation ?