I use Interface for declaring Constants as they are public static final. Lot of times I've seen people write a class with public static final constant variables and sometimes I've done the same. Which one is the better practice to implement, the Interface or using a class?
public class MyCodeConstants {
public static final String VALUE_1 = "VALUE1";
public static final String VALUE_2= "VALUE2";
}
or
public interface MyCodeConstants {
public static final String VALUE_1 = "VALUE1";
public static final String VALUE_2= "VALUE2";
}
WHICH ONE IS A BETTER PRACTICE TO USE AND WHY??